mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 01:18:23 +00:00
Fix: duplicated datasource in export of app (#9393)
* Fix: duplicated datasource in export of app * fix:code sanity --------- Co-authored-by: Kritagya <kriks.iitk@.com>
This commit is contained in:
parent
9302132b53
commit
38eb851c93
1 changed files with 3 additions and 2 deletions
|
|
@ -95,13 +95,14 @@ export class AppImportExportService {
|
|||
}
|
||||
const appVersions = await queryAppVersions.orderBy('app_versions.created_at', 'ASC').getMany();
|
||||
|
||||
let dataSources =
|
||||
const legacyLocalDataSources =
|
||||
appVersions?.length &&
|
||||
(await manager
|
||||
.createQueryBuilder(DataSource, 'data_sources')
|
||||
.where('data_sources.appVersionId IN(:...versionId)', {
|
||||
versionId: appVersions.map((v) => v.id),
|
||||
})
|
||||
.andWhere('data_sources.scope != :scope', { scope: DataSourceScopes.GLOBAL })
|
||||
.orderBy('data_sources.created_at', 'ASC')
|
||||
.getMany());
|
||||
|
||||
|
|
@ -127,7 +128,7 @@ export class AppImportExportService {
|
|||
|
||||
const globalDataSources = [...new Map(globalQueries.map((gq) => [gq.dataSource.id, gq.dataSource])).values()];
|
||||
|
||||
dataSources = [...dataSources, ...globalDataSources];
|
||||
const dataSources = [...legacyLocalDataSources, ...globalDataSources];
|
||||
|
||||
if (dataSources?.length) {
|
||||
dataQueries = await manager
|
||||
|
|
|
|||
Loading…
Reference in a new issue