From 01380a9ad3e20b682a0b440dc61b6b1036a7d1e5 Mon Sep 17 00:00:00 2001 From: Thomas <4159106+dtslvr@users.noreply.github.com> Date: Sat, 25 Dec 2021 15:30:35 +0100 Subject: [PATCH] Filter currencies with null value --- .../services/exchange-rate-data.service.ts | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) 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);