remove orgId

This commit is contained in:
Rudra deep Biswas 2025-05-13 19:12:34 +05:30
parent 29202a8e40
commit 01d73bd3f9

View file

@ -96,7 +96,7 @@ export class AppImportExportService {
protected componentsService: ComponentsService 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 // https://github.com/typeorm/typeorm/issues/3857
// Making use of query builder // Making use of query builder
// filter by search params // filter by search params
@ -106,7 +106,7 @@ export class AppImportExportService {
.createQueryBuilder(App, 'apps') .createQueryBuilder(App, 'apps')
.where('apps.id = :id AND apps.organization_id = :organizationId', { .where('apps.id = :id AND apps.organization_id = :organizationId', {
id, id,
organizationId: user?.organizationId || organizationId, organizationId: user?.organizationId,
}); });
const appToExport = await queryForAppToExport.getOne(); const appToExport = await queryForAppToExport.getOne();
@ -135,7 +135,7 @@ export class AppImportExportService {
const appEnvironments = await manager const appEnvironments = await manager
.createQueryBuilder(AppEnvironment, 'app_environments') .createQueryBuilder(AppEnvironment, 'app_environments')
.where('app_environments.organizationId = :organizationId', { .where('app_environments.organizationId = :organizationId', {
organizationId: user?.organizationId || organizationId, organizationId: user?.organizationId,
}) })
.orderBy('app_environments.createdAt', 'ASC') .orderBy('app_environments.createdAt', 'ASC')
.getMany(); .getMany();
@ -238,8 +238,7 @@ export class AppImportExportService {
externalResourceMappings = {}, externalResourceMappings = {},
isGitApp = false, isGitApp = false,
tooljetVersion = '', tooljetVersion = '',
cloning = false, cloning = false
organizationId?: string
): Promise<App> { ): Promise<App> {
if (typeof appParamsObj !== 'object') { if (typeof appParamsObj !== 'object') {
throw new BadRequestException('Invalid params for app import'); throw new BadRequestException('Invalid params for app import');
@ -271,8 +270,7 @@ export class AppImportExportService {
this.entityManager, //create new BC this.entityManager, //create new BC
schemaUnifiedAppParams, schemaUnifiedAppParams,
user, user,
isGitApp, isGitApp
organizationId
); );
const resourceMapping = await this.setupImportedAppAssociations( const resourceMapping = await this.setupImportedAppAssociations(
@ -282,8 +280,7 @@ export class AppImportExportService {
user, user,
externalResourceMappings, externalResourceMappings,
isNormalizedAppDefinitionSchema, isNormalizedAppDefinitionSchema,
currentTooljetVersion, currentTooljetVersion
organizationId
); );
await this.updateEntityReferencesForImportedApp(this.entityManager, resourceMapping); await this.updateEntityReferencesForImportedApp(this.entityManager, resourceMapping);