identity-admin 1.12.0 → 1.13.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.
@@ -293,16 +293,16 @@ let DashboardController = DashboardController_1 = class DashboardController {
293
293
  if (crudOperations && crudOperations.update && crudOperations.update.before) {
294
294
  recordParams = yield crudOperations.update.before(req, recordParams, currentUser);
295
295
  }
296
- const recordSaveResult = yield repository.update(record, recordParams);
296
+ var recordSaveResult = yield repository.update(record, recordParams);
297
297
  if (!recordSaveResult.isValid()) {
298
298
  return ResponseUtils_1.default.unprocessable(res, 'Invalid Data', recordSaveResult.getErrors());
299
299
  }
300
300
  // if (resource.properties.modelName === ModelNames.Settings) {
301
301
  // await AppSettings.run()
302
302
  // }
303
- // if (crudOperations && crudOperations.update && crudOperations.update.after) {
304
- // recordSaveResult = await crudOperations.update.after(req, recordSaveResult, currentUser)
305
- // }
303
+ if (crudOperations && crudOperations.update && crudOperations.update.after) {
304
+ recordSaveResult = yield crudOperations.update.after(req, recordSaveResult, currentUser);
305
+ }
306
306
  return ResponseUtils_1.default.ok(res, {
307
307
  record: recordSaveResult
308
308
  });
@@ -71,6 +71,11 @@ interface ICrudOperations {
71
71
  * @returns the params
72
72
  */
73
73
  before?: (req: IRequest, params: any, currentUser: Document) => Promise<any>;
74
+ /**
75
+ * After handler that gives you the access to the updated document.
76
+ * @returns the updated document
77
+ */
78
+ after?: (req: IRequest, document: Document, currentUser: Document) => Promise<Document>;
74
79
  };
75
80
  show?: {
76
81
  after?: (req: IRequest, record: Document) => Promise<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "identity-admin",
3
- "version": "1.12.0",
3
+ "version": "1.13.1",
4
4
  "description": "",
5
5
  "main": "lib/Dashboard.js",
6
6
  "types": "lib/Dashbord.d.ts",