From 9b4826ed23039e4cd251a8e823323277a96cb203 Mon Sep 17 00:00:00 2001 From: anil Date: Thu, 20 Jun 2024 13:25:11 +0300 Subject: [PATCH 1/2] fixing organization unmerge preview and typescript build --- backend/src/services/organizationService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/services/organizationService.ts b/backend/src/services/organizationService.ts index b5927e017e..b88bdbda4d 100644 --- a/backend/src/services/organizationService.ts +++ b/backend/src/services/organizationService.ts @@ -126,7 +126,7 @@ export default class OrganizationService extends LoggerBase { const secondaryBackup = mergeAction.unmergeBackup.secondary as IOrganizationUnmergeBackup for (const key of OrganizationService.ORGANIZATION_MERGE_FIELDS) { - if (!organization.manuallyChangedFields.includes(key)) { + if (!(organization.manuallyChangedFields || []).includes(key)) { // handle string arrays if ( key in @@ -1209,7 +1209,7 @@ export default class OrganizationService extends LoggerBase { 'tags', 'logo', ], - include: { identities: true, lfxMemberships: true }, + include: { identities: true, lfxMemberships: true, segments: true }, }, this.options, ) From 3405d62a70ba8af6fd775834eb4e8f66e8c24aeb Mon Sep 17 00:00:00 2001 From: anil Date: Thu, 20 Jun 2024 13:44:06 +0300 Subject: [PATCH 2/2] make include fields optional in orgRepo.findAndCountAll --- backend/src/database/repositories/organizationRepository.ts | 2 +- backend/src/services/organizationService.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/database/repositories/organizationRepository.ts b/backend/src/database/repositories/organizationRepository.ts index 2a4a4abc1a..ec4f553f0c 100644 --- a/backend/src/database/repositories/organizationRepository.ts +++ b/backend/src/database/repositories/organizationRepository.ts @@ -2190,7 +2190,7 @@ class OrganizationRepository { identities: true, lfxMemberships: true, segments: false, - }, + } as { identities?: boolean; lfxMemberships?: boolean; segments?: boolean }, }, options: IRepositoryOptions, ) { diff --git a/backend/src/services/organizationService.ts b/backend/src/services/organizationService.ts index b88bdbda4d..1d44d2c2fd 100644 --- a/backend/src/services/organizationService.ts +++ b/backend/src/services/organizationService.ts @@ -1209,7 +1209,7 @@ export default class OrganizationService extends LoggerBase { 'tags', 'logo', ], - include: { identities: true, lfxMemberships: true, segments: true }, + include: { identities: true, lfxMemberships: true }, }, this.options, )