@itilite/iui-user-management 0.4.8 → 0.4.9

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.
@@ -1507,7 +1507,7 @@ var makePrimaryAdmin = function makePrimaryAdmin(payload) {
1507
1507
  return new Promise(function (resolve, reject) {
1508
1508
  api$1.put(userAddEditUrl.primaryAdmin(payload.userId)).then(function (res) {
1509
1509
  if (res) {
1510
- IUIToastMessageService.sNotify(res.data.message.toString());
1510
+ IUIToastMessageService.sNotify(res.data.message);
1511
1511
  resolve();
1512
1512
  } else {
1513
1513
  reject(res);
@@ -1527,11 +1527,15 @@ var resetPasswordForUser = function resetPasswordForUser(data) {
1527
1527
  api$1.post("" + userAddEditUrl.resetPasswordForUserApi(), {
1528
1528
  email: data.email
1529
1529
  }).then(function (res) {
1530
- IUIToastMessageService.sNotify(res.data.status.toString());
1530
+ IUIToastMessageService.sNotify(res.data.status);
1531
1531
  resolve();
1532
1532
  })["catch"](function (err) {
1533
- if (!err.response.data.status) {
1534
- IUIToastMessageService.errNotify(err);
1533
+ var _err$response7, _err$response7$data;
1534
+
1535
+ if (!(err !== null && err !== void 0 && (_err$response7 = err.response) !== null && _err$response7 !== void 0 && (_err$response7$data = _err$response7.data) !== null && _err$response7$data !== void 0 && _err$response7$data.status)) {
1536
+ var _err$response8, _err$response8$data, _err$response8$data$m;
1537
+
1538
+ IUIToastMessageService.errNotify(err === null || err === void 0 ? void 0 : (_err$response8 = err.response) === null || _err$response8 === void 0 ? void 0 : (_err$response8$data = _err$response8.data) === null || _err$response8$data === void 0 ? void 0 : (_err$response8$data$m = _err$response8$data.message) === null || _err$response8$data$m === void 0 ? void 0 : _err$response8$data$m.email[0]);
1535
1539
  reject(err);
1536
1540
  return;
1537
1541
  }
@@ -1547,11 +1551,15 @@ var resendInviteForUser = function resendInviteForUser(data) {
1547
1551
  api$1.post(userAddEditUrl.resendInviteForUserApi(), {
1548
1552
  user_ids: data
1549
1553
  }).then(function (res) {
1550
- IUIToastMessageService.sNotify(res.data.message.toString());
1554
+ IUIToastMessageService.sNotify(res.data.message);
1551
1555
  resolve();
1552
1556
  })["catch"](function (err) {
1553
- if (!err.response.data.status) {
1554
- IUIToastMessageService.errNotify(err);
1557
+ var _err$response9, _err$response9$data;
1558
+
1559
+ if (!(err !== null && err !== void 0 && (_err$response9 = err.response) !== null && _err$response9 !== void 0 && (_err$response9$data = _err$response9.data) !== null && _err$response9$data !== void 0 && _err$response9$data.status)) {
1560
+ var _err$response10, _err$response10$data, _err$response10$data$;
1561
+
1562
+ IUIToastMessageService.errNotify(err === null || err === void 0 ? void 0 : (_err$response10 = err.response) === null || _err$response10 === void 0 ? void 0 : (_err$response10$data = _err$response10.data) === null || _err$response10$data === void 0 ? void 0 : (_err$response10$data$ = _err$response10$data.message) === null || _err$response10$data$ === void 0 ? void 0 : _err$response10$data$.email[0]);
1555
1563
  reject(err);
1556
1564
  return;
1557
1565
  }
@@ -1576,11 +1584,11 @@ var updateUser = function updateUser(payload, userId, inputChangeLog) {
1576
1584
  reject(res.data.errors);
1577
1585
  }
1578
1586
  })["catch"](function (err) {
1579
- var _err$response7;
1587
+ var _err$response11;
1580
1588
 
1581
1589
  var error = 'Opps, Something went error.';
1582
1590
 
1583
- if (err !== null && err !== void 0 && (_err$response7 = err.response) !== null && _err$response7 !== void 0 && _err$response7.data) {
1591
+ if (err !== null && err !== void 0 && (_err$response11 = err.response) !== null && _err$response11 !== void 0 && _err$response11.data) {
1584
1592
  if (err.response.data.errors && typeof err.response.data.errors === 'object' && Object.keys(err.response.data.errors).length) {
1585
1593
  reject(err.response.data.errors);
1586
1594
  return;
@@ -1629,9 +1637,9 @@ var deletePaymentCard = function deletePaymentCard(payload) {
1629
1637
  reject(res);
1630
1638
  }
1631
1639
  })["catch"](function (err) {
1632
- var _err$response8, _err$response8$data;
1640
+ var _err$response12, _err$response12$data;
1633
1641
 
1634
- IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$response8 = err.response) === null || _err$response8 === void 0 ? void 0 : (_err$response8$data = _err$response8.data) === null || _err$response8$data === void 0 ? void 0 : _err$response8$data.message) || 'Opps, Something went wrong.');
1642
+ IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$response12 = err.response) === null || _err$response12 === void 0 ? void 0 : (_err$response12$data = _err$response12.data) === null || _err$response12$data === void 0 ? void 0 : _err$response12$data.message) || 'Opps, Something went wrong.');
1635
1643
  reject(err);
1636
1644
  })["finally"](function () {
1637
1645
  dispatch(stopLoader());
@@ -1668,9 +1676,9 @@ var setDefaultPaymentCard = function setDefaultPaymentCard(payload) {
1668
1676
  reject(res);
1669
1677
  }
1670
1678
  })["catch"](function (err) {
1671
- var _err$response9, _err$response9$data;
1679
+ var _err$response13, _err$response13$data;
1672
1680
 
1673
- IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$response9 = err.response) === null || _err$response9 === void 0 ? void 0 : (_err$response9$data = _err$response9.data) === null || _err$response9$data === void 0 ? void 0 : _err$response9$data.message) || 'Opps, Something went wrong.');
1681
+ IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$response13 = err.response) === null || _err$response13 === void 0 ? void 0 : (_err$response13$data = _err$response13.data) === null || _err$response13$data === void 0 ? void 0 : _err$response13$data.message) || 'Opps, Something went wrong.');
1674
1682
  reject(err);
1675
1683
  })["finally"](function () {
1676
1684
  dispatch(stopLoader());
@@ -1694,9 +1702,9 @@ var verifyUserInfo = function verifyUserInfo(userId) {
1694
1702
  reject(res);
1695
1703
  }
1696
1704
  })["catch"](function (err) {
1697
- var _err$response10, _err$response10$data;
1705
+ var _err$response14, _err$response14$data;
1698
1706
 
1699
- IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$response10 = err.response) === null || _err$response10 === void 0 ? void 0 : (_err$response10$data = _err$response10.data) === null || _err$response10$data === void 0 ? void 0 : _err$response10$data.message) || 'Opps, Unable to fetch user info.');
1707
+ IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$response14 = err.response) === null || _err$response14 === void 0 ? void 0 : (_err$response14$data = _err$response14.data) === null || _err$response14$data === void 0 ? void 0 : _err$response14$data.message) || 'Opps, Unable to fetch user info.');
1700
1708
  setTimeout(function () {
1701
1709
  window.history.back();
1702
1710
  }, 1000);
@@ -1711,9 +1719,9 @@ var submitAddModalData = function submitAddModalData(tableName, data) {
1711
1719
  api$1.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
1712
1720
  resolve(res);
1713
1721
  })["catch"](function (err) {
1714
- var _err$response11, _err$response11$data;
1722
+ var _err$response15, _err$response15$data;
1715
1723
 
1716
- IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$response11 = err.response) === null || _err$response11 === void 0 ? void 0 : (_err$response11$data = _err$response11.data) === null || _err$response11$data === void 0 ? void 0 : _err$response11$data.message) || 'Opps, Something went wrong.');
1724
+ IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$response15 = err.response) === null || _err$response15 === void 0 ? void 0 : (_err$response15$data = _err$response15.data) === null || _err$response15$data === void 0 ? void 0 : _err$response15$data.message) || 'Opps, Something went wrong.');
1717
1725
  dispatch(stopLoader());
1718
1726
  });
1719
1727
  });
@@ -1723,8 +1731,6 @@ var rejectUserVerification = function rejectUserVerification(userId) {
1723
1731
  return function (dispatch) {
1724
1732
  return new Promise(function (resolve, reject) {
1725
1733
  api$1.get(userAddEditUrl.rejectUserVerification(userId)).then(function (res) {
1726
- console.log(res);
1727
-
1728
1734
  if (res.data.status === true) {
1729
1735
  var _res$data5;
1730
1736
 
@@ -1737,10 +1743,9 @@ var rejectUserVerification = function rejectUserVerification(userId) {
1737
1743
  reject(res);
1738
1744
  }
1739
1745
  })["catch"](function (err) {
1740
- var _err$response12, _err$response12$data;
1746
+ var _err$response16, _err$response16$data;
1741
1747
 
1742
- console.log(err);
1743
- IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$response12 = err.response) === null || _err$response12 === void 0 ? void 0 : (_err$response12$data = _err$response12.data) === null || _err$response12$data === void 0 ? void 0 : _err$response12$data.message) || 'Opps, Unable to reject user.');
1748
+ IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$response16 = err.response) === null || _err$response16 === void 0 ? void 0 : (_err$response16$data = _err$response16.data) === null || _err$response16$data === void 0 ? void 0 : _err$response16$data.message) || 'Opps, Unable to reject user.');
1744
1749
  reject(err);
1745
1750
  });
1746
1751
  });