Skip to content

Commit 79d817c

Browse files
committed
ISSUE #4641 fix bug
1 parent b9744fa commit 79d817c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

backend/src/v4/models/group.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
const { v5Path } = require("../../interop");
2121

2222
const { getCommonElements } = require(`${v5Path}/utils/helper/arrays`);
23+
const { deleteIfUndefined } = require(`${v5Path}/utils/helper/objects`);
2324
const { idTypes, idTypesToKeys } = require(`${v5Path}/models/metadata.constants`);
2425
const { getMetadataWithMatchingData } = require(`${v5Path}/models/metadata`);
2526
const { sharedIdsToExternalIds, getMeshesWithParentIds } = require(`${v5Path}/processors/teamspaces/projects/models/commons/scenes`);
@@ -200,10 +201,7 @@ function getObjectsArrayAsExternalIds(account, model, branch, rId, data) {
200201

201202
// have to have shared_ids, IFC or RVT ids, but not more than one
202203
if (
203-
(!containerEntry[idTypes.IFC] && !containerEntry[idTypes.RVT] && !containerEntry.shared_ids) ||
204-
!(containerEntry[idTypes.IFC] && !containerEntry[idTypes.RVT] && !containerEntry.shared_ids) ||
205-
!(!containerEntry[idTypes.IFC] && containerEntry[idTypes.RVT] && !containerEntry.shared_ids) ||
206-
!(!containerEntry[idTypes.IFC] && !containerEntry[idTypes.RVT] && containerEntry.shared_ids)
204+
getCommonElements([...Object.values(idTypes), "shared_ids"], Object.keys(deleteIfUndefined(containerEntry))).length !== 1
207205
) {
208206
return Promise.reject(responseCodes.INVALID_GROUP);
209207
}

0 commit comments

Comments
 (0)