@undp/carbon-library 1.0.54 → 1.0.55

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/cjs/index.js CHANGED
@@ -4909,24 +4909,21 @@ var AddNewUserComponent = function (props) {
4909
4909
  }); };
4910
4910
  var onUpdateUser = function () { return __awaiter(void 0, void 0, void 0, function () {
4911
4911
  var formOneValues, values, response, error_3;
4912
- var _a, _b, _c, _d;
4913
- return __generator(this, function (_e) {
4914
- switch (_e.label) {
4912
+ var _a;
4913
+ return __generator(this, function (_b) {
4914
+ switch (_b.label) {
4915
4915
  case 0:
4916
4916
  setLoading(true);
4917
4917
  formOneValues = formOne.getFieldsValue();
4918
4918
  formOneValues.phoneNo = PhoneInput.formatPhoneNumberIntl(formOneValues.phoneNo);
4919
- _e.label = 1;
4919
+ _b.label = 1;
4920
4920
  case 1:
4921
- _e.trys.push([1, 3, , 4]);
4921
+ _b.trys.push([1, 3, , 4]);
4922
4922
  values = {
4923
4923
  id: (_a = state === null || state === void 0 ? void 0 : state.record) === null || _a === void 0 ? void 0 : _a.id,
4924
4924
  name: formOneValues === null || formOneValues === void 0 ? void 0 : formOneValues.name,
4925
4925
  phoneNo: formOneValues === null || formOneValues === void 0 ? void 0 : formOneValues.phoneNo,
4926
4926
  };
4927
- if (((_b = state === null || state === void 0 ? void 0 : state.record) === null || _b === void 0 ? void 0 : _b.companyRole) === exports.CompanyRole.MINISTRY) {
4928
- values.sectoralScope = (_d = (_c = state === null || state === void 0 ? void 0 : state.record) === null || _c === void 0 ? void 0 : _c.company) === null || _d === void 0 ? void 0 : _d.sectoralScope;
4929
- }
4930
4927
  if (ability.can(Action.Update, classTransformer.plainToClass(User, state === null || state === void 0 ? void 0 : state.record), "role"))
4931
4928
  values.role = formOneValues === null || formOneValues === void 0 ? void 0 : formOneValues.role;
4932
4929
  if (ability.can(Action.Update, classTransformer.plainToClass(User, state === null || state === void 0 ? void 0 : state.record), "email"))
@@ -4934,7 +4931,7 @@ var AddNewUserComponent = function (props) {
4934
4931
  console.log("form one values -- > ", values, state.record);
4935
4932
  return [4 /*yield*/, put("national/user/update", values)];
4936
4933
  case 2:
4937
- response = _e.sent();
4934
+ response = _b.sent();
4938
4935
  if (response.status === 200 || response.status === 201) {
4939
4936
  antd.message.open({
4940
4937
  type: "success",
@@ -4948,7 +4945,7 @@ var AddNewUserComponent = function (props) {
4948
4945
  }
4949
4946
  return [3 /*break*/, 4];
4950
4947
  case 3:
4951
- error_3 = _e.sent();
4948
+ error_3 = _b.sent();
4952
4949
  console.log("Error in user update", error_3);
4953
4950
  antd.message.open({
4954
4951
  type: "error",