|
|
@ -205,10 +205,15 @@ export class ImportService { |
|
|
const existingPlatforms = await this.platformService.getPlatforms(); |
|
|
const existingPlatforms = await this.platformService.getPlatforms(); |
|
|
|
|
|
|
|
|
for (const platform of platformsDto) { |
|
|
for (const platform of platformsDto) { |
|
|
// Check if there is any existing platform with the same ID or URL
|
|
|
// Check if there is any existing platform with the same ID, otherwise
|
|
|
const existingPlatform = existingPlatforms.find(({ id, url }) => { |
|
|
// fall back to a platform with the same URL
|
|
|
return id === platform.id || url === platform.url; |
|
|
const existingPlatform = |
|
|
}); |
|
|
existingPlatforms.find(({ id }) => { |
|
|
|
|
|
return id === platform.id; |
|
|
|
|
|
}) ?? |
|
|
|
|
|
existingPlatforms.find(({ url }) => { |
|
|
|
|
|
return url === platform.url; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
if (existingPlatform) { |
|
|
if (existingPlatform) { |
|
|
// Store the new to old platform ID mappings for creating accounts
|
|
|
// Store the new to old platform ID mappings for creating accounts
|
|
|
|