From c002e372855ea550e5198afbd35119480268ed0b Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 24 Feb 2024 19:45:51 +0100 Subject: [PATCH] Feature/add missing default currency to prepare currencies function (#3042) * Add missing default currency * Update changelog --- CHANGELOG.md | 4 ++++ .../services/exchange-rate-data/exchange-rate-data.service.ts | 2 +- .../src/lib/currency-selector/currency-selector.component.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f51662bd9..5fc948b02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Improved the language localization for German (`de`) - Upgraded `prisma` from version `5.9.1` to `5.10.2` +### Fixed + +- Added the missing default currency to the prepare currencies function in the exchange rate data service + ## 2.55.0 - 2024-02-22 ### Added diff --git a/apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts b/apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts index 2d169737a..148fac560 100644 --- a/apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts +++ b/apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts @@ -451,7 +451,7 @@ export class ExchangeRateDataService { } private async prepareCurrencies(): Promise { - let currencies: string[] = []; + let currencies: string[] = [DEFAULT_CURRENCY]; ( await this.prismaService.account.findMany({ diff --git a/libs/ui/src/lib/currency-selector/currency-selector.component.ts b/libs/ui/src/lib/currency-selector/currency-selector.component.ts index 620f0d3eb..8c9415689 100644 --- a/libs/ui/src/lib/currency-selector/currency-selector.component.ts +++ b/libs/ui/src/lib/currency-selector/currency-selector.component.ts @@ -159,7 +159,7 @@ export class CurrencySelectorComponent private validateRequired() { const requiredCheck = super.required - ? !super.value.label || !super.value.value + ? !super.value?.label || !super.value?.value : false; if (requiredCheck) {