From 01d73bd3f9ded044745a8a0ca792ddf29d12f044 Mon Sep 17 00:00:00 2001 From: Rudra deep Biswas Date: Tue, 13 May 2025 19:12:34 +0530 Subject: [PATCH] remove orgId --- .../apps/services/app-import-export.service.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/server/src/modules/apps/services/app-import-export.service.ts b/server/src/modules/apps/services/app-import-export.service.ts index b9914b0e8a..1e1c3008eb 100644 --- a/server/src/modules/apps/services/app-import-export.service.ts +++ b/server/src/modules/apps/services/app-import-export.service.ts @@ -96,7 +96,7 @@ export class AppImportExportService { protected componentsService: ComponentsService ) {} - async export(user: User, id: string, searchParams: any = {}, organizationId?: string): Promise<{ appV2: App }> { + async export(user: User, id: string, searchParams: any = {}): Promise<{ appV2: App }> { // https://github.com/typeorm/typeorm/issues/3857 // Making use of query builder // filter by search params @@ -106,7 +106,7 @@ export class AppImportExportService { .createQueryBuilder(App, 'apps') .where('apps.id = :id AND apps.organization_id = :organizationId', { id, - organizationId: user?.organizationId || organizationId, + organizationId: user?.organizationId, }); const appToExport = await queryForAppToExport.getOne(); @@ -135,7 +135,7 @@ export class AppImportExportService { const appEnvironments = await manager .createQueryBuilder(AppEnvironment, 'app_environments') .where('app_environments.organizationId = :organizationId', { - organizationId: user?.organizationId || organizationId, + organizationId: user?.organizationId, }) .orderBy('app_environments.createdAt', 'ASC') .getMany(); @@ -238,8 +238,7 @@ export class AppImportExportService { externalResourceMappings = {}, isGitApp = false, tooljetVersion = '', - cloning = false, - organizationId?: string + cloning = false ): Promise { if (typeof appParamsObj !== 'object') { throw new BadRequestException('Invalid params for app import'); @@ -271,8 +270,7 @@ export class AppImportExportService { this.entityManager, //create new BC schemaUnifiedAppParams, user, - isGitApp, - organizationId + isGitApp ); const resourceMapping = await this.setupImportedAppAssociations( @@ -282,8 +280,7 @@ export class AppImportExportService { user, externalResourceMappings, isNormalizedAppDefinitionSchema, - currentTooljetVersion, - organizationId + currentTooljetVersion ); await this.updateEntityReferencesForImportedApp(this.entityManager, resourceMapping);