From 49d1493c65088107462cd09538ceffec37f2452a Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 8 Dec 2023 13:35:49 +0100 Subject: [PATCH] review fixes --- src/services/new/collection/utils/get-parents.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/services/new/collection/utils/get-parents.ts b/src/services/new/collection/utils/get-parents.ts index c745c642..17aa3d9a 100644 --- a/src/services/new/collection/utils/get-parents.ts +++ b/src/services/new/collection/utils/get-parents.ts @@ -37,8 +37,12 @@ export const getParents = async ({ctx, trx, collectionIds}: GetCollectionsParent qb2.select(`${CollectionModel.tableName}.*`) .from(CollectionModel.tableName) .where({ - [`${CollectionModel.tableName}.${CollectionModelColumn.TenantId}`]: - tenantId, + ...(onlyMirrored + ? {} + : { + [`${CollectionModel.tableName}.${CollectionModelColumn.TenantId}`]: + tenantId, + }), [`${CollectionModel.tableName}.${CollectionModelColumn.ProjectId}`]: projectId, [`${CollectionModel.tableName}.${CollectionModelColumn.DeletedAt}`]: