mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 09:45:18 +00:00
19 lines
546 B
TypeScript
19 lines
546 B
TypeScript
import path from 'path';
|
|
import { Application } from '@nocobase/server';
|
|
import { registerModels } from '@nocobase/database';
|
|
import * as models from './models';
|
|
import * as actions from './actions';
|
|
|
|
export default async function (this: Application, options = {}) {
|
|
const database = this.database;
|
|
registerModels(models);
|
|
|
|
database.import({
|
|
directory: path.resolve(__dirname, 'collections'),
|
|
});
|
|
|
|
for (const [name, action] of Object.entries(actions)) {
|
|
this.resourcer.registerActionHandler(`ui_schemas:${name}`, action);
|
|
}
|
|
}
|