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