identity-admin 1.27.0 → 1.27.1

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.
@@ -287,7 +287,9 @@ let DashboardController = DashboardController_1 = class DashboardController {
287
287
  record = yield repository.save(recordParams);
288
288
  }
289
289
  if (!record.isValid() || !record.document) {
290
- return ResponseUtils_1.default.unprocessable(res, 'Invalid Data', record.getErrors());
290
+ const errors = record.getErrors();
291
+ const errorMessage = errors && errors.length > 0 ? errors[0].message : 'Invalid Data';
292
+ return ResponseUtils_1.default.unprocessable(res, errorMessage, record.getErrors());
291
293
  }
292
294
  if ((_g = resource.properties) === null || _g === void 0 ? void 0 : _g.enableLog) {
293
295
  const newRecord = yield repository.findById(record.getDocument()._id);
@@ -174,6 +174,9 @@ let Repository = Repository_1 = class Repository {
174
174
  };
175
175
  });
176
176
  }
177
+ else {
178
+ errors = [{ path: e.keyPattern, type: "", message: e.message }];
179
+ }
177
180
  }
178
181
  return new SaveResult_1.default(document, errors);
179
182
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "identity-admin",
3
- "version": "1.27.0",
3
+ "version": "1.27.1",
4
4
  "description": "",
5
5
  "main": "lib/Dashboard.js",
6
6
  "types": "lib/Dashbord.d.ts",