mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 07:57:20 +00:00
fix: add collections after update hook
This commit is contained in:
parent
d408cd4c1f
commit
71024dbaa0
@ -0,0 +1,8 @@
|
||||
import CollectionModel from '../models/collection';
|
||||
|
||||
export default async function (model: CollectionModel, options: any = {}) {
|
||||
const { migrate = true } = options;
|
||||
if (migrate) {
|
||||
await model.migrate(options);
|
||||
}
|
||||
}
|
@ -1,16 +1,18 @@
|
||||
import collectionsBeforeValidate from './collections-before-validate';
|
||||
import collectionsAfterCreate from './collections-after-create';
|
||||
import collectionsAfterUpdate from './collections-after-update';
|
||||
|
||||
import fieldsBeforeValidate from './fields-before-validate';
|
||||
import fieldsAfterCreate from './fields-after-create';
|
||||
import generateName from './generateName';
|
||||
import fieldsAfterBulkUpdate from './fields-after-bulk-update';
|
||||
|
||||
import generateName from './generateName';
|
||||
|
||||
export default {
|
||||
collections: {
|
||||
beforeValidate: collectionsBeforeValidate,
|
||||
afterCreate: collectionsAfterCreate,
|
||||
afterUpdate: collectionsAfterCreate,
|
||||
afterUpdate: collectionsAfterUpdate,
|
||||
},
|
||||
fields: {
|
||||
beforeValidate: fieldsBeforeValidate,
|
||||
|
Loading…
Reference in New Issue
Block a user