Optimize price API response size reduce the number of query to that API

This commit is contained in:
nymkappa
2023-02-23 13:13:20 +09:00
parent f6c7839524
commit 5749820999
6 changed files with 132 additions and 50 deletions

View File

@@ -305,7 +305,10 @@ export class ApiService {
);
}
getHistoricalPrice$(): Observable<Conversion> {
return this.httpClient.get<Conversion>( this.apiBaseUrl + this.apiBasePath + '/api/v1/historical-price');
getHistoricalPrice$(timestamp: number | undefined): Observable<Conversion> {
return this.httpClient.get<Conversion>(
this.apiBaseUrl + this.apiBasePath + '/api/v1/historical-price' +
(timestamp ? `?timestamp=${timestamp}` : '')
);
}
}