tachybase_todo/packages/plugin-action-logs/src/server.ts

18 lines
467 B
TypeScript
Raw Normal View History

2021-12-07 15:21:16 +08:00
import path from 'path';
import { afterCreate, afterUpdate, afterDestroy } from './hooks';
import { Plugin } from '@nocobase/server';
export default class PluginActionLogs extends Plugin {
async beforeLoad() {
this.db.on('afterCreate', afterCreate);
this.db.on('afterUpdate', afterUpdate);
this.db.on('afterDestroy', afterDestroy);
}
2021-12-07 15:21:16 +08:00
async load() {
await this.db.import({
2021-12-07 15:21:16 +08:00
directory: path.resolve(__dirname, 'collections'),
});
}
}