Browse Source

Support account platforms in activities import

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

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

@ -205,9 +205,14 @@ 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) {

Loading…
Cancel
Save