diff --git a/CHANGELOG.md b/CHANGELOG.md index 77526981d..8b406c49f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Fixed + +- Filtered potential `null` currencies + ## 1.94.0 - 25.12.2021 ### Added diff --git a/apps/api/src/services/exchange-rate-data.service.ts b/apps/api/src/services/exchange-rate-data.service.ts index e0e0e614f..e83516e27 100644 --- a/apps/api/src/services/exchange-rate-data.service.ts +++ b/apps/api/src/services/exchange-rate-data.service.ts @@ -157,7 +157,12 @@ export class ExchangeRateDataService { await this.prismaService.account.findMany({ distinct: ['currency'], orderBy: [{ currency: 'asc' }], - select: { currency: true } + select: { currency: true }, + where: { + currency: { + not: null + } + } }) ).forEach((account) => { currencies.push(account.currency); @@ -167,7 +172,12 @@ export class ExchangeRateDataService { await this.prismaService.settings.findMany({ distinct: ['currency'], orderBy: [{ currency: 'asc' }], - select: { currency: true } + select: { currency: true }, + where: { + currency: { + not: null + } + } }) ).forEach((userSettings) => { currencies.push(userSettings.currency); @@ -177,7 +187,12 @@ export class ExchangeRateDataService { await this.prismaService.symbolProfile.findMany({ distinct: ['currency'], orderBy: [{ currency: 'asc' }], - select: { currency: true } + select: { currency: true }, + where: { + currency: { + not: null + } + } }) ).forEach((symbolProfile) => { currencies.push(symbolProfile.currency);