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
|
-
|
|
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);
|