mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 07:25:15 +00:00
fix(database): remove the setUpHooks method
This commit is contained in:
parent
695b953a8f
commit
c2725ac9ca
@ -13,7 +13,7 @@ export type RepositoryType = typeof Repository;
|
||||
|
||||
export type CollectionSortable = string | boolean | { name?: string; scopeKey?: string };
|
||||
|
||||
export interface CollectionOptions extends Omit<ModelOptions, 'name'> {
|
||||
export interface CollectionOptions extends Omit<ModelOptions, 'name' | 'hooks'> {
|
||||
name: string;
|
||||
tableName?: string;
|
||||
filterTargetKey?: string;
|
||||
@ -201,19 +201,11 @@ export class Collection<
|
||||
this.setFields(options.fields, false);
|
||||
this.setRepository(options.repository);
|
||||
|
||||
if (newOptions.hooks) {
|
||||
this.setUpHooks(newOptions.hooks);
|
||||
}
|
||||
|
||||
this.context.database.emit('afterUpdateCollection', this);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
setUpHooks(bindHooks) {
|
||||
(<any>this.model)._setupHooks(bindHooks);
|
||||
}
|
||||
|
||||
setSortable(sortable) {
|
||||
if (!sortable) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user