File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -120,10 +120,13 @@ class AddCoupons extends React.Component {
120120
121121
122122 onProductsSelected = ( productTypeId , products ) => {
123- const newCouponProducts = this . state . couponProducts
124- newCouponProducts [ productTypeId ] = products
123+ const currentProductsForProductTypeId = { }
124+ currentProductsForProductTypeId [ productTypeId ] = products
125125 this . setState ( {
126- couponProducts : newCouponProducts
126+ couponProducts : {
127+ ...this . state . couponProducts ,
128+ ...currentProductsForProductTypeId
129+ }
127130 } )
128131 }
129132
@@ -165,6 +168,9 @@ class AddCoupons extends React.Component {
165168 preFilledProducts = {
166169 this . state . couponProducts [ this . state . modalProductTypeId ]
167170 }
171+ currentCouponProducts = {
172+ this . state . couponProducts [ this . state . modalProductTypeId ]
173+ }
168174 isModalOpen = { this . state . isModalOpen }
169175 handleCloseModal = { this . handleCloseModal }
170176 onProductsSelected = { this . onProductsSelected }
Original file line number Diff line number Diff line change @@ -172,6 +172,9 @@ class AddBulkCoupon extends React.Component {
172172 preFilledProducts = {
173173 this . state . couponProducts [ this . state . modalProductTypeId ]
174174 }
175+ currentCouponProducts = {
176+ this . state . couponProducts [ this . state . modalProductTypeId ]
177+ }
175178 isModalOpen = { this . state . isModalOpen }
176179 handleCloseModal = { this . handleCloseModal }
177180 onProductsSelected = { this . onProductsSelected }
You can’t perform that action at this time.
0 commit comments