adminizer 4.4.0-build.149 → 4.4.0-build.150
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.
|
@@ -3,6 +3,10 @@ import { EditorOptions } from "@toast-ui/editor/types/editor";
|
|
|
3
3
|
import { GridSettings as HandsontableSettings } from "handsontable/settings";
|
|
4
4
|
import { GroupAP } from "models/GroupAP";
|
|
5
5
|
import { UserAP } from "models/UserAP";
|
|
6
|
+
/**
|
|
7
|
+
* Controller function type - async function that handles requests and returns a response
|
|
8
|
+
*/
|
|
9
|
+
export type ControllerFunction = (req: ReqType, res: ResType) => Promise<any>;
|
|
6
10
|
export type AdminpanelIcon = MaterialIcon;
|
|
7
11
|
export type FieldsTypes = "string" | "password" | "date" | "datetime" | "time" | "integer" | "number" | "float" | "color" | "email" | "month" | "week" | "range" | "boolean" | "binary" | "text" | "longtext" | "mediumtext" | "ckeditor" | "wysiwyg" | "texteditor" | "word" | 'tui' | 'tuieditor' | 'toast-ui' | "jsoneditor" | "json" | "array" | "object" | "ace" | "code" | "html" | "xml" | "aceeditor" | "menu" | "schedule" | "worktime" | "association" | "association-many" | "select" | "select-many" | "table" | "geojson" | "mediamanager" |
|
|
8
12
|
/**
|
|
@@ -427,7 +431,7 @@ export interface CreateUpdateConfig {
|
|
|
427
431
|
* You can change standard controller for any entity by this property
|
|
428
432
|
* Can be either a string path (for dynamic import) or a controller function
|
|
429
433
|
* */
|
|
430
|
-
controller?: string |
|
|
434
|
+
controller?: string | ControllerFunction;
|
|
431
435
|
}
|
|
432
436
|
export interface HrefConfig {
|
|
433
437
|
id: string;
|
package/package.json
CHANGED
package/system/Router.js
CHANGED
|
@@ -132,7 +132,7 @@ export default class Router {
|
|
|
132
132
|
adminizer.app.all(`${adminizer.config.routePrefix}/model/${model}/add`, adminizer.policyManager.bindPolicies(policies, controller.default));
|
|
133
133
|
}
|
|
134
134
|
else {
|
|
135
|
-
// Direct function reference
|
|
135
|
+
// Direct function reference (controller function matches middleware signature)
|
|
136
136
|
adminizer.app.all(`${adminizer.config.routePrefix}/model/${model}/add`, adminizer.policyManager.bindPolicies(policies, addHandler.controller));
|
|
137
137
|
}
|
|
138
138
|
}
|
|
@@ -155,7 +155,7 @@ export default class Router {
|
|
|
155
155
|
adminizer.app.all(`${adminizer.config.routePrefix}/model/${model}/edit/:id`, adminizer.policyManager.bindPolicies(policies, controller.default));
|
|
156
156
|
}
|
|
157
157
|
else {
|
|
158
|
-
// Direct function reference
|
|
158
|
+
// Direct function reference (controller function matches middleware signature)
|
|
159
159
|
adminizer.app.all(`${adminizer.config.routePrefix}/model/${model}/edit/:id`, adminizer.policyManager.bindPolicies(policies, editHandler.controller));
|
|
160
160
|
}
|
|
161
161
|
}
|