Browse Source

Fix missing platform icon in preview of activities import

pull/8148/head
Thomas Kaul 3 days ago
parent
commit
3a9b578efd
  1. 2
      apps/api/src/app/import/import.service.spec.ts
  2. 16
      apps/api/src/app/import/import.service.ts

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

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

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

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

Loading…
Cancel
Save