Feature/add date range support to portfolio holdings page (#3303)

* Add date range support

* Update changelog
pull/3306/head
Thomas Kaul 8 months ago committed by GitHub
parent bed9ae916c
commit 212aa6a63b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Added
- Added the date range support to the portfolio holdings page
### Changed
- Removed the date range support in the activities table on the portfolio activities page (experimental)

@ -290,6 +290,7 @@ export class PortfolioController {
@Query('assetClasses') filterByAssetClasses?: string,
@Query('holdingType') filterByHoldingType?: string,
@Query('query') filterBySearchQuery?: string,
@Query('range') dateRange: DateRange = 'max',
@Query('tags') filterByTags?: string
): Promise<PortfolioHoldingsResponse> {
const filters = this.apiService.buildFiltersFromQueryParams({
@ -301,6 +302,7 @@ export class PortfolioController {
});
const { holdings } = await this.portfolioService.getDetails({
dateRange,
filters,
impersonationId,
userId: this.request.user.id

@ -123,7 +123,8 @@ export class HoldingsPageComponent implements OnDestroy, OnInit {
}
return this.dataService.fetchPortfolioHoldings({
filters
filters,
range: this.user?.settings?.dateRange
});
}

@ -464,13 +464,21 @@ export class DataService {
}
public fetchPortfolioHoldings({
filters
filters,
range
}: {
filters?: Filter[];
} = {}) {
range?: DateRange;
}) {
let params = this.buildFiltersAsQueryParams({ filters });
if (range) {
params = params.append('range', range);
}
return this.http
.get<PortfolioHoldingsResponse>('/api/v1/portfolio/holdings', {
params: this.buildFiltersAsQueryParams({ filters })
params
})
.pipe(
map((response) => {

Loading…
Cancel
Save