Browse Source

fix market price fetch in case symbols are missing

pull/239/head
Valentin Zickner 4 years ago
committed by Thomas
parent
commit
ed731afc66
  1. 4
      apps/api/src/app/core/portfolio-calculator.ts

4
apps/api/src/app/core/portfolio-calculator.ts

@ -172,10 +172,12 @@ export class PortfolioCalculator {
if (!marketSymbolMap[date]) {
marketSymbolMap[date] = {};
}
if (marketSymbol.marketPrice) {
marketSymbolMap[date][marketSymbol.symbol] = new Big(
marketSymbol.marketPrice
);
}
}
let hasErrors = false;
const startString = format(start, DATE_FORMAT);
@ -377,11 +379,13 @@ export class PortfolioCalculator {
if (!marketSymbolMap[date]) {
marketSymbolMap[date] = {};
}
if (marketSymbol.marketPrice) {
marketSymbolMap[date][marketSymbol.symbol] = new Big(
marketSymbol.marketPrice
);
}
}
}
const results = [];
for (

Loading…
Cancel
Save