mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 11:36:42 +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 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;
|
name: string;
|
||||||
tableName?: string;
|
tableName?: string;
|
||||||
filterTargetKey?: string;
|
filterTargetKey?: string;
|
||||||
@ -201,19 +201,11 @@ export class Collection<
|
|||||||
this.setFields(options.fields, false);
|
this.setFields(options.fields, false);
|
||||||
this.setRepository(options.repository);
|
this.setRepository(options.repository);
|
||||||
|
|
||||||
if (newOptions.hooks) {
|
|
||||||
this.setUpHooks(newOptions.hooks);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.context.database.emit('afterUpdateCollection', this);
|
this.context.database.emit('afterUpdateCollection', this);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
setUpHooks(bindHooks) {
|
|
||||||
(<any>this.model)._setupHooks(bindHooks);
|
|
||||||
}
|
|
||||||
|
|
||||||
setSortable(sortable) {
|
setSortable(sortable) {
|
||||||
if (!sortable) {
|
if (!sortable) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user