diff --git a/apps/api/src/app/admin/admin.controller.ts b/apps/api/src/app/admin/admin.controller.ts index 7b3e01a731..605f5fe6e4 100644 --- a/apps/api/src/app/admin/admin.controller.ts +++ b/apps/api/src/app/admin/admin.controller.ts @@ -11,6 +11,7 @@ import { getIntervalFromDateRange } from '@ghostfolio/common/calculation-helper' import { DATA_GATHERING_QUEUE_PRIORITY_HIGH, DATA_GATHERING_QUEUE_PRIORITY_MEDIUM, + DEFAULT_CURRENCY, GATHER_ASSET_PROFILE_PROCESS_JOB_NAME, GATHER_ASSET_PROFILE_PROCESS_JOB_OPTIONS } from '@ghostfolio/common/config'; @@ -274,7 +275,8 @@ export class AdminController { return this.adminService.addAssetProfile({ dataSource, symbol, - currency: this.request.user.settings.settings.baseCurrency + currency: + this.request.user.settings.settings.baseCurrency ?? DEFAULT_CURRENCY }); } diff --git a/apps/api/src/app/admin/admin.service.ts b/apps/api/src/app/admin/admin.service.ts index 53c82aeec3..f551536ca0 100644 --- a/apps/api/src/app/admin/admin.service.ts +++ b/apps/api/src/app/admin/admin.service.ts @@ -71,7 +71,7 @@ export class AdminService { currency, dataSource, symbol - }: AssetProfileIdentifier & { currency?: string }): Promise< + }: AssetProfileIdentifier & { currency: string }): Promise< SymbolProfile | never > { try { @@ -82,12 +82,6 @@ export class AdminService { ); } - if (!currency) { - throw new BadRequestException( - `currency is required for the data source ("${dataSource}")` - ); - } - return this.symbolProfileService.add({ currency, dataSource,