Skip to content

Commit 8972514

Browse files
author
JasmeetLuthra
committed
product chooser view all btn fix
1 parent 63b4c1b commit 8972514

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

pages/admin/coupons2/add.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff 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}

pages/admin/coupons2/bulk.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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}

0 commit comments

Comments
 (0)