@fonixtree/magic-design 2.0.22 → 2.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -179,7 +179,7 @@ var BundleCampaign = function BundleCampaign(props) {
179
179
  campaignName = _b[0],
180
180
  setCampaignName = _b[1];
181
181
 
182
- var _c = (0, _react.useState)(''),
182
+ var _c = (0, _react.useState)(window.magicDesign.storeId ? window.magicDesign.storeId : ''),
183
183
  storeId = _c[0],
184
184
  setStoreId = _c[1];
185
185
 
@@ -241,7 +241,7 @@ var BundleCampaign = function BundleCampaign(props) {
241
241
 
242
242
  var reset = function reset() {
243
243
  setCampaignName('');
244
- setStoreId('');
244
+ setStoreId(window.magicDesign.storeId ? window.magicDesign.storeId : '');
245
245
  setCmpState('A,B');
246
246
  };
247
247
 
@@ -246,14 +246,22 @@ function CouponTable(props) {
246
246
 
247
247
  var getCoupons = function getCoupons(params) {
248
248
  return __awaiter(_this, void 0, void 0, function () {
249
- var res, list;
249
+ var newParams, res, list;
250
250
  return __generator(this, function (_a) {
251
251
  switch (_a.label) {
252
252
  case 0:
253
253
  setLoading(true);
254
+ newParams = __assign(__assign({}, params), {
255
+ tableFlag: 'effective',
256
+ isPublic: 'Y',
257
+ state: 'A',
258
+ couponLocation: 'Promotion',
259
+ pageTotal: false,
260
+ storeId: window.magicDesign.storeId ? window.magicDesign.storeId : ''
261
+ });
254
262
  return [4
255
263
  /*yield*/
256
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/coupons/couponList/page?tableFlag=effective&isPublic=Y&state=A&pageTotal=false&couponLocation=Promotion", params, 'GET')];
264
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/coupons/couponList/page", newParams, 'GET')];
257
265
 
258
266
  case 1:
259
267
  res = _a.sent();
@@ -220,7 +220,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
220
220
  productName = _e[0],
221
221
  setProductName = _e[1];
222
222
 
223
- var _f = (0, _react.useState)(window.magicDesign.storeId ? [window.magicDesign.storeId] : []),
223
+ var _f = (0, _react.useState)(window.magicDesign.storeId ? window.magicDesign.storeId : []),
224
224
  storeId = _f[0],
225
225
  setStoreId = _f[1];
226
226
 
@@ -357,7 +357,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
357
357
  setProductName('');
358
358
  setProductCode('');
359
359
  setBrandId([]);
360
- setStoreId([]);
360
+ setStoreId(window.magicDesign.storeId ? window.magicDesign.storeId : []);
361
361
  };
362
362
 
363
363
  (0, _react.useEffect)(function () {
@@ -179,7 +179,7 @@ var BundleCampaign = function BundleCampaign(props) {
179
179
  campaignName = _b[0],
180
180
  setCampaignName = _b[1];
181
181
 
182
- var _c = (0, _react.useState)(''),
182
+ var _c = (0, _react.useState)(window.magicDesign.storeId ? window.magicDesign.storeId : ''),
183
183
  storeId = _c[0],
184
184
  setStoreId = _c[1];
185
185
 
@@ -241,7 +241,7 @@ var BundleCampaign = function BundleCampaign(props) {
241
241
 
242
242
  var reset = function reset() {
243
243
  setCampaignName('');
244
- setStoreId('');
244
+ setStoreId(window.magicDesign.storeId ? window.magicDesign.storeId : '');
245
245
  setCmpState('A,B');
246
246
  };
247
247
 
@@ -246,14 +246,22 @@ function CouponTable(props) {
246
246
 
247
247
  var getCoupons = function getCoupons(params) {
248
248
  return __awaiter(_this, void 0, void 0, function () {
249
- var res, list;
249
+ var newParams, res, list;
250
250
  return __generator(this, function (_a) {
251
251
  switch (_a.label) {
252
252
  case 0:
253
253
  setLoading(true);
254
+ newParams = __assign(__assign({}, params), {
255
+ tableFlag: 'effective',
256
+ isPublic: 'Y',
257
+ state: 'A',
258
+ couponLocation: 'Promotion',
259
+ pageTotal: false,
260
+ storeId: window.magicDesign.storeId ? window.magicDesign.storeId : ''
261
+ });
254
262
  return [4
255
263
  /*yield*/
256
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/coupons/couponList/page?tableFlag=effective&isPublic=Y&state=A&pageTotal=false&couponLocation=Promotion", params, 'GET')];
264
+ , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/coupons/couponList/page", newParams, 'GET')];
257
265
 
258
266
  case 1:
259
267
  res = _a.sent();
@@ -220,7 +220,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
220
220
  productName = _e[0],
221
221
  setProductName = _e[1];
222
222
 
223
- var _f = (0, _react.useState)(window.magicDesign.storeId ? [window.magicDesign.storeId] : []),
223
+ var _f = (0, _react.useState)(window.magicDesign.storeId ? window.magicDesign.storeId : []),
224
224
  storeId = _f[0],
225
225
  setStoreId = _f[1];
226
226
 
@@ -357,7 +357,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
357
357
  setProductName('');
358
358
  setProductCode('');
359
359
  setBrandId([]);
360
- setStoreId([]);
360
+ setStoreId(window.magicDesign.storeId ? window.magicDesign.storeId : []);
361
361
  };
362
362
 
363
363
  (0, _react.useEffect)(function () {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "2.0.22",
4
+ "version": "2.0.23",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",