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

12 lines
308 B
TypeScript
Raw Normal View History

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