Browse Source

Bugfix/platform icon in preview of activities import (#8148)

* Fix missing platform icon in preview of activities import

* Update changelog
pull/8157/head^2
Thomas Kaul 2 days ago
committed by GitHub
parent
commit
63132a29fe
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 2
      apps/api/src/app/import/import.service.spec.ts
  3. 16
      apps/api/src/app/import/import.service.ts

1
CHANGELOG.md

@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Fixed the missing platform icon in the preview step of the activities import
- Fixed the link of the _Manage Asset Profile_ button in the holding detail dialog before the holding has loaded - Fixed the link of the _Manage Asset Profile_ button in the holding detail dialog before the holding has loaded
## 3.85.0 - 2026-10-12 ## 3.85.0 - 2026-10-12

2
apps/api/src/app/import/import.service.spec.ts

@ -69,7 +69,7 @@ describe('ImportService', () => {
importService = new ImportService( importService = new ImportService(
{ {
getAccounts: jest.fn().mockResolvedValue([]) accounts: jest.fn().mockResolvedValue([])
} as unknown as AccountService, } as unknown as AccountService,
{ {
createActivity, createActivity,

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

@ -38,6 +38,7 @@ import {
} from '@ghostfolio/common/interfaces'; } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { import {
AccountWithPlatform,
AccountWithValue, AccountWithValue,
OrderWithAccount, OrderWithAccount,
UserWithSettings UserWithSettings
@ -769,11 +770,14 @@ export class ImportService {
userId: user.id userId: user.id
}); });
const accounts = (await this.accountService.getAccounts(user.id)).map( const accounts: Pick<AccountWithPlatform, 'id' | 'name' | 'platform'>[] = (
({ id, name }) => { await this.accountService.accounts({
return { id, name }; include: { platform: true },
} where: { userId: user.id }
); })
).map(({ id, name, platform }) => {
return { id, name, platform };
});
if (isDryRun) { if (isDryRun) {
accountsWithBalancesDto accountsWithBalancesDto
@ -888,7 +892,7 @@ export class ImportService {
let order: let order:
| OrderWithAccount | OrderWithAccount
| (Omit<OrderWithAccount, 'account' | 'SymbolProfile' | 'tags'> & { | (Omit<OrderWithAccount, 'account' | 'SymbolProfile' | 'tags'> & {
account?: { id: string; name: string }; account?: Pick<AccountWithPlatform, 'id' | 'name' | 'platform'>;
tags?: { id: string; name: string }[]; tags?: { id: string; name: string }[];
}); });

Loading…
Cancel
Save