Browse Source
Task/refactor getDividends() from async to sync (#6222)
* Refactor from async to sync
Task/update-locales
Thomas Kaul
6 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
3 additions and
3 deletions
-
apps/api/src/app/portfolio/portfolio.controller.ts
-
apps/api/src/app/portfolio/portfolio.service.ts
|
|
@ -329,7 +329,7 @@ export class PortfolioController { |
|
|
types: ['DIVIDEND'] |
|
|
types: ['DIVIDEND'] |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
let dividends = await this.portfolioService.getDividends({ |
|
|
let dividends = this.portfolioService.getDividends({ |
|
|
activities, |
|
|
activities, |
|
|
groupBy |
|
|
groupBy |
|
|
}); |
|
|
}); |
|
|
|
|
|
@ -325,13 +325,13 @@ export class PortfolioService { |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public async getDividends({ |
|
|
public getDividends({ |
|
|
activities, |
|
|
activities, |
|
|
groupBy |
|
|
groupBy |
|
|
}: { |
|
|
}: { |
|
|
activities: Activity[]; |
|
|
activities: Activity[]; |
|
|
groupBy?: GroupBy; |
|
|
groupBy?: GroupBy; |
|
|
}): Promise<InvestmentItem[]> { |
|
|
}): InvestmentItem[] { |
|
|
let dividends = activities.map(({ currency, date, value }) => { |
|
|
let dividends = activities.map(({ currency, date, value }) => { |
|
|
return { |
|
|
return { |
|
|
date: format(date, DATE_FORMAT), |
|
|
date: format(date, DATE_FORMAT), |
|
|
|