@itilite/iui-user-management 1.4.781 → 1.4.842

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.
@@ -6648,6 +6648,26 @@ var UserAddEdit = function UserAddEdit(props) {
6648
6648
  console.log('errorrr', error);
6649
6649
  });
6650
6650
  };
6651
+ var fetchLoggedUserCardsDetails = function fetchLoggedUserCardsDetails() {
6652
+ fetch(userAddEditUrl.cardsAddUsersDetails(), {
6653
+ method: 'GET',
6654
+ headers: {
6655
+ 'Content-Type': 'application/json',
6656
+ authorization: "Bearer " + IUILocalStorageService$5.getAccessToken()
6657
+ }
6658
+ }).then(function (response) {
6659
+ return response.json();
6660
+ }).then(function (res) {
6661
+ var _res$roles2;
6662
+ if (res !== null && res !== void 0 && (_res$roles2 = res.roles) !== null && _res$roles2 !== void 0 && _res$roles2.length) {
6663
+ dispatch(setCardsDetails(res));
6664
+ } else {
6665
+ IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
6666
+ }
6667
+ })["catch"](function (error) {
6668
+ console.log('errorrr', error);
6669
+ });
6670
+ };
6651
6671
  useEffect(function () {
6652
6672
  var countryObject = countryContactCode.find(function (t) {
6653
6673
  return t.dial_code === countryDialCode;
@@ -7348,8 +7368,13 @@ var UserAddEdit = function UserAddEdit(props) {
7348
7368
  useEffect(function () {
7349
7369
  if (isRendered === true) {
7350
7370
  renderFields === null || renderFields === void 0 ? void 0 : renderFields.products.forEach(function (prod) {
7371
+ console.log(prod, isProfile, editUserId, id, 'card check');
7351
7372
  if ((prod === null || prod === void 0 ? void 0 : prod.name) === 'card') {
7352
- fetchEditUserCardsDetails(isProfile ? id : editUserId);
7373
+ if (isProfile || editUserId) {
7374
+ fetchEditUserCardsDetails(isProfile ? id : editUserId);
7375
+ } else {
7376
+ fetchLoggedUserCardsDetails();
7377
+ }
7353
7378
  }
7354
7379
  });
7355
7380
  setPersonalInfoInput(_extends({}, personalInfoInput, {