Browse Source

Bugfix/filter currencies with null value (#579)

* Filter currencies with null value

* Update changelog
pull/581/head
Thomas Kaul 3 years ago
committed by GitHub
parent
commit
bbc4e64cb4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      CHANGELOG.md
  2. 21
      apps/api/src/services/exchange-rate-data.service.ts

6
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

21
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);

Loading…
Cancel
Save