nocobase/packages/plugins/@nocobase/plugin-ui-schema-storage/src/server/model.ts

12 lines
333 B
TypeScript
Raw Normal View History

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