Feature/extend database seed (#23)

* Extend database seed

* platforms
* transactions of demo user

* Improve error handling
This commit is contained in:
Thomas
2021-04-19 14:14:16 +02:00
committed by GitHub
parent 3d34aa5e80
commit ec4dbf2a51
3 changed files with 176 additions and 14 deletions

View File

@@ -58,8 +58,8 @@ export class ExchangeRateDataService {
if (!this.currencies[pair]) {
// Not found, calculate indirectly via USD
this.currencies[pair] =
resultExtended[`${currency1}${Currency.USD}`][date].marketPrice *
resultExtended[`${Currency.USD}${currency2}`][date].marketPrice;
resultExtended[`${currency1}${Currency.USD}`]?.[date]?.marketPrice *
resultExtended[`${Currency.USD}${currency2}`]?.[date]?.marketPrice;
// Calculate the opposite direction
this.currencies[`${currency2}${currency1}`] = 1 / this.currencies[pair];