From 30b006bb4517b3f04e60002304521d110628a80c Mon Sep 17 00:00:00 2001 From: chenos Date: Sun, 10 Jan 2021 09:40:29 +0800 Subject: [PATCH] fix: ids not empty --- packages/plugin-collections/src/models/collection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-collections/src/models/collection.ts b/packages/plugin-collections/src/models/collection.ts index 31259bb2e..003ebe745 100644 --- a/packages/plugin-collections/src/models/collection.ts +++ b/packages/plugin-collections/src/models/collection.ts @@ -238,7 +238,7 @@ export class CollectionModel extends BaseModel { ids.push(model.id); } } - if (collection.get('internal')) { + if (ids.length && collection.get('internal')) { await collection.updateAssociations({ [key]: ids, });