identity-admin 1.11.0 → 1.13.0
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.
|
@@ -251,7 +251,7 @@ let DashboardController = DashboardController_1 = class DashboardController {
|
|
|
251
251
|
return ResponseUtils_1.default.unprocessable(res, 'Invalid Data', record.getErrors());
|
|
252
252
|
}
|
|
253
253
|
if (crudOperations && crudOperations.create && crudOperations.create.after) {
|
|
254
|
-
record = yield crudOperations.create.after(req, record, currentUser);
|
|
254
|
+
record = yield crudOperations.create.after(req, record, currentUser, recordParams);
|
|
255
255
|
}
|
|
256
256
|
return ResponseUtils_1.default.created(res, {
|
|
257
257
|
record
|
|
@@ -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
|
-
|
|
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
|
-
|
|
304
|
-
|
|
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
|
});
|
|
@@ -33,6 +33,9 @@ class SchemaGenerator {
|
|
|
33
33
|
model = modelAndPopulatedString[0];
|
|
34
34
|
populatedString = modelAndPopulatedString[1];
|
|
35
35
|
}
|
|
36
|
+
if (fieldType === helpers_1.FieldTypes.DATE) {
|
|
37
|
+
model[field].withTime = model[field].withTime ? model[field].withTime : false;
|
|
38
|
+
}
|
|
36
39
|
else if (fieldType === helpers_1.FieldTypes.ARRAY) {
|
|
37
40
|
model[field].required = schema[field].caster.isRequired;
|
|
38
41
|
if (schema[field].schema) {
|
|
@@ -62,7 +62,7 @@ interface ICrudOperations {
|
|
|
62
62
|
* After handler that gives you the access to the saved document.
|
|
63
63
|
* @returns the saved document
|
|
64
64
|
*/
|
|
65
|
-
after?: (req: IRequest, document: Document, currentUser: Document) => Promise<Document>;
|
|
65
|
+
after?: (req: IRequest, document: Document, currentUser: Document, params: any) => Promise<Document>;
|
|
66
66
|
};
|
|
67
67
|
update?: {
|
|
68
68
|
/**
|
|
@@ -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<{
|
|
@@ -202,6 +207,11 @@ export interface IFieldValue {
|
|
|
202
207
|
* @default image
|
|
203
208
|
*/
|
|
204
209
|
fileType?: FileTypes;
|
|
210
|
+
/**
|
|
211
|
+
* Specify if the date is shown with time or not. Only used if the field type is Date
|
|
212
|
+
* @default false
|
|
213
|
+
*/
|
|
214
|
+
withTime?: boolean;
|
|
205
215
|
}
|
|
206
216
|
export interface IVirtualValue {
|
|
207
217
|
/**
|