Browse Source

Bugfix/fix export functionality of platforms (#4379)

* Fix export functionality of platforms

* Update changelog
pull/4381/head
Thomas Kaul 4 weeks ago
committed by GitHub
parent
commit
8f4f29571b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 16
      apps/api/src/app/export/export.service.ts

1
CHANGELOG.md

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Handled an exception in the export functionality related to platforms
- Handled an exception in the benchmark service related to unnamed asset profiles - Handled an exception in the benchmark service related to unnamed asset profiles
## 2.142.0 - 2025-02-28 ## 2.142.0 - 2025-02-28

16
apps/api/src/app/export/export.service.ts

@ -26,7 +26,7 @@ export class ExportService {
userCurrency: string; userCurrency: string;
userId: string; userId: string;
}): Promise<Export> { }): Promise<Export> {
const platforms: Platform[] = []; const platformsMap: { [platformId: string]: Platform } = {};
const accounts = ( const accounts = (
await this.accountService.accounts({ await this.accountService.accounts({
@ -46,15 +46,11 @@ export class ExportService {
id, id,
isExcluded, isExcluded,
name, name,
platformId, Platform: platform,
Platform: platform platformId
}) => { }) => {
if ( if (platformId) {
!platforms.some(({ id: currentPlatformId }) => { platformsMap[platformId] = platform;
return currentPlatformId === platform.id;
})
) {
platforms.push(platform);
} }
return { return {
@ -99,7 +95,7 @@ export class ExportService {
return { return {
meta: { date: new Date().toISOString(), version: environment.version }, meta: { date: new Date().toISOString(), version: environment.version },
accounts, accounts,
platforms, platforms: Object.values(platformsMap),
tags, tags,
activities: activities.map( activities: activities.map(
({ ({

Loading…
Cancel
Save