mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
fix: merge option with filter target key (#5558)
This commit is contained in:
parent
809ae5c011
commit
e818195dd1
@ -653,9 +653,14 @@ export class Collection<
|
|||||||
updateOptions(options: CollectionOptions, mergeOptions?: any) {
|
updateOptions(options: CollectionOptions, mergeOptions?: any) {
|
||||||
let newOptions = lodash.cloneDeep(options);
|
let newOptions = lodash.cloneDeep(options);
|
||||||
newOptions = merge(this.options, newOptions, mergeOptions);
|
newOptions = merge(this.options, newOptions, mergeOptions);
|
||||||
this.context.database.emit('beforeUpdateCollection', this, newOptions);
|
|
||||||
this.options = newOptions;
|
|
||||||
|
|
||||||
|
if (options.filterTargetKey) {
|
||||||
|
newOptions.filterTargetKey = options.filterTargetKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.context.database.emit('beforeUpdateCollection', this, newOptions);
|
||||||
|
|
||||||
|
this.options = newOptions;
|
||||||
this.setFields(options.fields, false);
|
this.setFields(options.fields, false);
|
||||||
if (options.repository) {
|
if (options.repository) {
|
||||||
this.setRepository(options.repository);
|
this.setRepository(options.repository);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user