Browse Source

Destructure query parameters in controllers

pull/7505/head
Thomas Kaul 4 weeks ago
parent
commit
bf426a855f
  1. 3
      apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts
  2. 8
      libs/ui/src/lib/services/data.service.ts

3
apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts

@ -341,8 +341,7 @@ export class GfAccountDetailDialogComponent implements OnInit {
} }
], ],
range: DEFAULT_DATE_RANGE, range: DEFAULT_DATE_RANGE,
withExcludedAccounts: true, withExcludedAccounts: true
withItems: true
}) })
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))
}).subscribe({ }).subscribe({

8
libs/ui/src/lib/services/data.service.ts

@ -731,13 +731,11 @@ export class DataService {
public fetchPortfolioPerformance({ public fetchPortfolioPerformance({
filters, filters,
range, range,
withExcludedAccounts = false, withExcludedAccounts = false
withItems = false
}: { }: {
filters?: Filter[]; filters?: Filter[];
range: DateRange; range: DateRange;
withExcludedAccounts?: boolean; withExcludedAccounts?: boolean;
withItems?: boolean;
}): Observable<PortfolioPerformanceResponse> { }): Observable<PortfolioPerformanceResponse> {
let params = this.buildFiltersAsQueryParams({ filters }); let params = this.buildFiltersAsQueryParams({ filters });
params = params.append('range', range); params = params.append('range', range);
@ -746,10 +744,6 @@ export class DataService {
params = params.append('withExcludedAccounts', withExcludedAccounts); params = params.append('withExcludedAccounts', withExcludedAccounts);
} }
if (withItems) {
params = params.append('withItems', withItems);
}
return this.http return this.http
.get<any>(`/api/v2/portfolio/performance`, { .get<any>(`/api/v2/portfolio/performance`, {
params params

Loading…
Cancel
Save