tachybase_todo/packages/plugin-ui-schema/src/server.ts

19 lines
643 B
TypeScript
Raw Normal View History

2021-07-11 22:20:54 +08:00
import path from 'path';
import { Application } from '@nocobase/server';
import { registerModels, Table } from '@nocobase/database';
import * as models from './models';
2021-07-19 23:57:54 +08:00
import { create, update, getTree } from './actions';
2021-07-11 22:20:54 +08:00
export default async function (this: Application, options = {}) {
const database = this.database;
registerModels(models);
database.import({
directory: path.resolve(__dirname, 'collections'),
});
2021-07-17 22:35:50 +08:00
this.resourcer.registerActionHandler('ui_schemas:create', create);
2021-07-19 23:57:54 +08:00
this.resourcer.registerActionHandler('ui_schemas:update', update);
2021-07-12 22:13:48 +08:00
this.resourcer.registerActionHandler('ui_schemas:getTree', getTree);
2021-07-11 22:20:54 +08:00
}