Browse Source

Support account platforms in activities import

pull/7515/head
Thomas Kaul 4 weeks ago
parent
commit
3e63a41c22
  1. 13
      apps/api/src/app/import/import.service.ts

13
apps/api/src/app/import/import.service.ts

@ -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

Loading…
Cancel
Save