mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-04 05:08:42 +08: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 collectionsBeforeValidate from './collections-before-validate';
|
||||||
import collectionsAfterCreate from './collections-after-create';
|
import collectionsAfterCreate from './collections-after-create';
|
||||||
|
import collectionsAfterUpdate from './collections-after-update';
|
||||||
|
|
||||||
import fieldsBeforeValidate from './fields-before-validate';
|
import fieldsBeforeValidate from './fields-before-validate';
|
||||||
import fieldsAfterCreate from './fields-after-create';
|
import fieldsAfterCreate from './fields-after-create';
|
||||||
import generateName from './generateName';
|
|
||||||
import fieldsAfterBulkUpdate from './fields-after-bulk-update';
|
import fieldsAfterBulkUpdate from './fields-after-bulk-update';
|
||||||
|
|
||||||
|
import generateName from './generateName';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
collections: {
|
collections: {
|
||||||
beforeValidate: collectionsBeforeValidate,
|
beforeValidate: collectionsBeforeValidate,
|
||||||
afterCreate: collectionsAfterCreate,
|
afterCreate: collectionsAfterCreate,
|
||||||
afterUpdate: collectionsAfterCreate,
|
afterUpdate: collectionsAfterUpdate,
|
||||||
},
|
},
|
||||||
fields: {
|
fields: {
|
||||||
beforeValidate: fieldsBeforeValidate,
|
beforeValidate: fieldsBeforeValidate,
|
||||||
|
Loading…
Reference in New Issue
Block a user