@itilite/iui-user-management 1.4.7733 → 1.4.8421

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
@@ -3291,7 +3291,7 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
3291
3291
  isError: !!errMsg[i],
3292
3292
  placeholder: "Example label - \u201CManager\u201D"
3293
3293
  }));
3294
- })))), type === 'travel' && paymentDetails && /*#__PURE__*/React__default.createElement(PaymentCards, {
3294
+ })))), type === 'travel' && paymentDetails && isProfile && /*#__PURE__*/React__default.createElement(PaymentCards, {
3295
3295
  paymentDetails: paymentDetails,
3296
3296
  paymentMethod: paymentMethod
3297
3297
  }));
@@ -6651,6 +6651,26 @@ var UserAddEdit = function UserAddEdit(props) {
6651
6651
  console.log('errorrr', error);
6652
6652
  });
6653
6653
  };
6654
+ var fetchLoggedUserCardsDetails = function fetchLoggedUserCardsDetails() {
6655
+ fetch(userAddEditUrl.cardsAddUsersDetails(), {
6656
+ method: 'GET',
6657
+ headers: {
6658
+ 'Content-Type': 'application/json',
6659
+ authorization: "Bearer " + IUILocalStorageService$5.getAccessToken()
6660
+ }
6661
+ }).then(function (response) {
6662
+ return response.json();
6663
+ }).then(function (res) {
6664
+ var _res$roles2;
6665
+ if (res !== null && res !== void 0 && (_res$roles2 = res.roles) !== null && _res$roles2 !== void 0 && _res$roles2.length) {
6666
+ dispatch(setCardsDetails(res));
6667
+ } else {
6668
+ IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
6669
+ }
6670
+ })["catch"](function (error) {
6671
+ console.log('errorrr', error);
6672
+ });
6673
+ };
6654
6674
  React.useEffect(function () {
6655
6675
  var countryObject = countryContactCode.find(function (t) {
6656
6676
  return t.dial_code === countryDialCode;
@@ -7351,8 +7371,13 @@ var UserAddEdit = function UserAddEdit(props) {
7351
7371
  React.useEffect(function () {
7352
7372
  if (isRendered === true) {
7353
7373
  renderFields === null || renderFields === void 0 ? void 0 : renderFields.products.forEach(function (prod) {
7354
- if ((prod === null || prod === void 0 ? void 0 : prod.name) === 'card' && (isProfile || editUserId)) {
7355
- fetchEditUserCardsDetails(isProfile ? id : editUserId);
7374
+ console.log(prod, isProfile, editUserId, id, 'card check');
7375
+ if ((prod === null || prod === void 0 ? void 0 : prod.name) === 'card') {
7376
+ if (isProfile || editUserId) {
7377
+ fetchEditUserCardsDetails(isProfile ? id : editUserId);
7378
+ } else {
7379
+ fetchLoggedUserCardsDetails();
7380
+ }
7356
7381
  }
7357
7382
  });
7358
7383
  setPersonalInfoInput(_extends({}, personalInfoInput, {