tachybase_todo/packages/plugins/ui-schema-storage/src/model.ts

12 lines
333 B
TypeScript
Raw Normal View History

2022-02-08 20:58:57 +08: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 20:58:57 +08:00
export { UiSchemaModel };