@itilite/iui-user-management 0.4.219 → 0.4.220

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
@@ -1118,6 +1118,24 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
1118
1118
  });
1119
1119
  }
1120
1120
  }
1121
+ if (payload.uploadedFiles && payload.uploadedFiles.length > 0) {
1122
+ res.fields.files = payload.uploadedFiles.filter(function (_file) {
1123
+ return !_file.isExistingFile;
1124
+ }).map(function (_file) {
1125
+ return {
1126
+ file_type: _file.file_type,
1127
+ file_path: _file.file_path,
1128
+ user_file_name: _file.user_file_name,
1129
+ upload: _file.upload
1130
+ };
1131
+ });
1132
+ }
1133
+ if (payload.filesForDelete.length > 0) {
1134
+ res.fields.filesToDelete = payload.filesForDelete;
1135
+ }
1136
+ if (payload.profilePicDelete.length > 0) {
1137
+ res.fields.profilePicDelete = payload.profilePicDelete;
1138
+ }
1121
1139
  }
1122
1140
  return res;
1123
1141
  };
@@ -5812,6 +5830,24 @@ var UserAddEdit = function UserAddEdit(props) {
5812
5830
  return _extends({}, prevState, expenseApprovers);
5813
5831
  });
5814
5832
  }
5833
+ var _uploadedDocs2 = [];
5834
+ res.files.forEach(function (_file) {
5835
+ _uploadedDocs2.push({
5836
+ user_file_name: _file.user_file_name,
5837
+ id: _file.id,
5838
+ isExistingFile: true,
5839
+ file_type: _file.file_type
5840
+ });
5841
+ });
5842
+ if (res && res.profile_pic) {
5843
+ _uploadedDocs2.push({
5844
+ user_file_name: res.profile_pic.user_file_name,
5845
+ id: res.profile_pic.id,
5846
+ isExistingFile: true,
5847
+ file_type: res.profile_pic.file_type
5848
+ });
5849
+ }
5850
+ setUploadedFiles(_uploadedDocs2);
5815
5851
  }
5816
5852
  })["catch"](function () {})["finally"](function () {
5817
5853
  dispatch(stopLoader());