2022-02-08 20:58:57 +08:00
|
|
|
import { MagicAttributeModel } from '@nocobase/database';
|
2022-02-18 12:29:03 +08:00
|
|
|
import { HookType } from './server-hooks';
|
2022-01-19 10:09:30 +08:00
|
|
|
|
2022-02-18 12:29:03 +08:00
|
|
|
class UiSchemaModel extends MagicAttributeModel {
|
|
|
|
getServerHooksByType(type: HookType) {
|
|
|
|
const hooks = this.get('x-server-hooks') || [];
|
|
|
|
return hooks.filter((hook) => hook.type === type);
|
|
|
|
}
|
|
|
|
}
|
2022-02-08 20:58:57 +08:00
|
|
|
|
|
|
|
export { UiSchemaModel };
|