fix(plugin-collection-manager): cannot destructure property 'skipExist' of 'loadOptions' as it is undefined.

This commit is contained in:
chenos 2022-01-22 16:42:25 +08:00
parent 31340f4773
commit 5e7e3c2c46
2 changed files with 3 additions and 4 deletions

View File

@ -49,8 +49,8 @@ const api = new Application({
},
});
api.plugin(require('@nocobase/plugin-collection-manager'));
api.plugin(require('@nocobase/plugin-ui-schema-storage'));
api.plugin(require('@nocobase/plugin-collection-manager').default);
api.plugin(require('@nocobase/plugin-ui-schema-storage').default);
// api.plugin(require('@nocobase/plugin-acl'));
if (process.argv.length < 3) {

View File

@ -9,12 +9,11 @@ interface LoadOptions {
}
export class CollectionModel extends MagicAttributeModel {
get db(): Database {
return (<any>this.constructor).database;
}
async load(loadOptions?: LoadOptions) {
async load(loadOptions: LoadOptions = {}) {
const { skipExist, skipField } = loadOptions;
const name = this.get('name');
let collection: Collection;