Browse Source

Fix GroupBy for investment

pull/5027/head
Daniel Devaud 1 year ago
parent
commit
d56d6f944f
  1. 15
      apps/api/src/app/portfolio/portfolio.service.ts

15
apps/api/src/app/portfolio/portfolio.service.ts

@ -317,14 +317,21 @@ export class PortfolioService {
withDataDecimation: false
});
let investments = items.map(
({ date, investmentValueWithCurrencyEffect }) => {
let investments: InvestmentItem[];
if (groupBy) {
investments = portfolioCalculator.getInvestmentsByGroup({
groupBy,
data: items
});
} else {
investments = items.map(({ date, investmentValueWithCurrencyEffect }) => {
return {
date,
investment: investmentValueWithCurrencyEffect
};
}
);
});
}
let streaks: PortfolioInvestments['streaks'];

Loading…
Cancel
Save