@salesgenterp/ui-components 0.4.145 → 0.4.146

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.
package/dist/index.js CHANGED
@@ -5056,28 +5056,40 @@ var MyProfile = function MyProfile(_ref) {
5056
5056
  handleSubmit = _useForm.handleSubmit,
5057
5057
  control = _useForm.control,
5058
5058
  reset = _useForm.reset;
5059
+ React.useEffect(function () {
5060
+ (function () {
5061
+ try {
5062
+ var _temp2 = _catch(function () {
5063
+ return Promise.resolve(API$1({
5064
+ apiEndPoint: apiEndPoint,
5065
+ token: token,
5066
+ url: "/ecommerce/customer",
5067
+ errorMessage: 'Error in getting user profile data.'
5068
+ })).then(function (data) {
5069
+ setUserDetails(data === null || data === void 0 ? void 0 : data.customerDto);
5070
+ reset(data === null || data === void 0 ? void 0 : data.customerDto);
5071
+ });
5072
+ }, function () {});
5073
+ return _temp2 && _temp2.then ? _temp2.then(function () {}) : void 0;
5074
+ } catch (e) {
5075
+ Promise.reject(e);
5076
+ }
5077
+ })();
5078
+ }, []);
5059
5079
  React.useEffect(function () {
5060
5080
  try {
5061
- return Promise.resolve(API$1({
5062
- apiEndPoint: apiEndPoint,
5063
- token: token,
5064
- url: "/ecommerce/customer",
5065
- errorMessage: 'Error in getting user profile data.'
5066
- })).then(function (data) {
5067
- setUserDetails(data === null || data === void 0 ? void 0 : data.customerDto);
5068
- reset(data === null || data === void 0 ? void 0 : data.customerDto);
5069
- });
5081
+ return Promise.resolve(getCountryData()).then(function () {});
5070
5082
  } catch (e) {
5071
5083
  Promise.reject(e);
5072
5084
  }
5073
5085
  }, []);
5074
5086
  var updateProfile = function updateProfile(formData) {
5075
5087
  try {
5076
- var _temp3 = function _temp3() {
5088
+ var _temp5 = function _temp5() {
5077
5089
  setIsLoading(false);
5078
5090
  };
5079
5091
  setIsLoading(true);
5080
- var _temp4 = _catch(function () {
5092
+ var _temp6 = _catch(function () {
5081
5093
  return Promise.resolve(API$1({
5082
5094
  apiEndPoint: apiEndPoint,
5083
5095
  token: token,
@@ -5088,7 +5100,7 @@ var MyProfile = function MyProfile(_ref) {
5088
5100
  successMessage: 'Profile updated successfully.'
5089
5101
  })).then(function () {});
5090
5102
  }, function () {});
5091
- return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
5103
+ return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(_temp5) : _temp5(_temp6));
5092
5104
  } catch (e) {
5093
5105
  return Promise.reject(e);
5094
5106
  }
@@ -6021,14 +6033,17 @@ var StoreDetails = function StoreDetails(_ref) {
6021
6033
  control = _useForm.control;
6022
6034
  var getStoreData = function getStoreData() {
6023
6035
  try {
6024
- return Promise.resolve(API$1({
6025
- apiEndPoint: apiEndPoint,
6026
- token: token,
6027
- url: "/ecommerce/customer/store/" + (storeData === null || storeData === void 0 ? void 0 : storeData.id) + "/address",
6028
- errorMessage: 'Error in getting store data.'
6029
- })).then(function (data) {
6030
- setStoreAddresses(data);
6031
- });
6036
+ var _temp2 = _catch(function () {
6037
+ return Promise.resolve(API$1({
6038
+ apiEndPoint: apiEndPoint,
6039
+ token: token,
6040
+ url: "/ecommerce/customer/store/" + (storeData === null || storeData === void 0 ? void 0 : storeData.id) + "/address",
6041
+ errorMessage: 'Error in getting store data.'
6042
+ })).then(function (data) {
6043
+ setStoreAddresses(data);
6044
+ });
6045
+ }, function () {});
6046
+ return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
6032
6047
  } catch (e) {
6033
6048
  return Promise.reject(e);
6034
6049
  }
@@ -6040,11 +6055,11 @@ var StoreDetails = function StoreDetails(_ref) {
6040
6055
  }, []);
6041
6056
  var updateStoreData = function updateStoreData(formData) {
6042
6057
  try {
6043
- var _temp3 = function _temp3() {
6058
+ var _temp5 = function _temp5() {
6044
6059
  setIsLoading(false);
6045
6060
  };
6046
6061
  setIsLoading(true);
6047
- var _temp4 = _catch(function () {
6062
+ var _temp6 = _catch(function () {
6048
6063
  return Promise.resolve(API$1({
6049
6064
  apiEndPoint: apiEndPoint,
6050
6065
  token: token,
@@ -6057,7 +6072,7 @@ var StoreDetails = function StoreDetails(_ref) {
6057
6072
  setStoreDetails(_extends({}, storeDetails, response));
6058
6073
  });
6059
6074
  }, function () {});
6060
- return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
6075
+ return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(_temp5) : _temp5(_temp6));
6061
6076
  } catch (e) {
6062
6077
  return Promise.reject(e);
6063
6078
  }
@@ -6347,18 +6362,23 @@ var StoreTabs = function StoreTabs(_ref) {
6347
6362
  setValue(newValue);
6348
6363
  };
6349
6364
  React.useEffect(function () {
6350
- try {
6351
- return Promise.resolve(API$1({
6352
- apiEndPoint: apiEndPoint,
6353
- token: token,
6354
- url: "/ecommerce/customer/store/" + (selectedStore === null || selectedStore === void 0 ? void 0 : selectedStore.id) + "/details",
6355
- errorMessage: 'Error in getting store data.'
6356
- })).then(function (data) {
6357
- setStoreData(data);
6358
- });
6359
- } catch (e) {
6360
- Promise.reject(e);
6361
- }
6365
+ (function () {
6366
+ try {
6367
+ var _temp2 = _catch(function () {
6368
+ return Promise.resolve(API$1({
6369
+ apiEndPoint: apiEndPoint,
6370
+ token: token,
6371
+ url: "/ecommerce/customer/store/" + (selectedStore === null || selectedStore === void 0 ? void 0 : selectedStore.id) + "/details",
6372
+ errorMessage: 'Error in getting store data.'
6373
+ })).then(function (data) {
6374
+ setStoreData(data);
6375
+ });
6376
+ }, function () {});
6377
+ return _temp2 && _temp2.then ? _temp2.then(function () {}) : void 0;
6378
+ } catch (e) {
6379
+ Promise.reject(e);
6380
+ }
6381
+ })();
6362
6382
  }, []);
6363
6383
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(material.Box, {
6364
6384
  sx: {
@@ -6430,14 +6450,17 @@ var StoreList = function StoreList(_ref) {
6430
6450
  setStoreDataList = _useState3[1];
6431
6451
  var getStoreDataList = function getStoreDataList() {
6432
6452
  try {
6433
- return Promise.resolve(API$1({
6434
- apiEndPoint: apiEndPoint,
6435
- token: token,
6436
- url: "/ecommerce/customer/store/list",
6437
- errorMessage: 'Error in getting user profile data.'
6438
- })).then(function (data) {
6439
- setStoreDataList(data);
6440
- });
6453
+ var _temp2 = _catch(function () {
6454
+ return Promise.resolve(API$1({
6455
+ apiEndPoint: apiEndPoint,
6456
+ token: token,
6457
+ url: "/ecommerce/customer/store/list",
6458
+ errorMessage: 'Error in getting user profile data.'
6459
+ })).then(function (data) {
6460
+ setStoreDataList(data);
6461
+ });
6462
+ }, function () {});
6463
+ return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
6441
6464
  } catch (e) {
6442
6465
  return Promise.reject(e);
6443
6466
  }