From 3e63a41c2290f715fc83f11d6f46bc139b435610 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 2 Aug 2026 16:54:31 +0200 Subject: [PATCH] Support account platforms in activities import --- apps/api/src/app/import/import.service.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index 23b5f7c1a0..52b0662d67 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -205,10 +205,15 @@ export class ImportService { const existingPlatforms = await this.platformService.getPlatforms(); for (const platform of platformsDto) { - // Check if there is any existing platform with the same ID or URL - const existingPlatform = existingPlatforms.find(({ id, url }) => { - return id === platform.id || url === platform.url; - }); + // Check if there is any existing platform with the same ID, otherwise + // fall back to a platform with the same URL + const existingPlatform = + existingPlatforms.find(({ id }) => { + return id === platform.id; + }) ?? + existingPlatforms.find(({ url }) => { + return url === platform.url; + }); if (existingPlatform) { // Store the new to old platform ID mappings for creating accounts