Add timespan switch for pool stats and load more for pool's blocks

This commit is contained in:
nymkappa
2022-02-10 19:16:00 +09:00
parent 3f55aabc53
commit f2abedfbaa
4 changed files with 91 additions and 52 deletions

View File

@@ -138,6 +138,10 @@ export class ApiService {
}
getPoolBlocks$(poolId: number, fromHeight: number): Observable<BlockExtended[]> {
return this.httpClient.get<BlockExtended[]>(this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/pool-blocks/${poolId}/${fromHeight}`);
if (fromHeight !== undefined) {
return this.httpClient.get<BlockExtended[]>(this.apiBaseUrl + this.apiBasePath +`/api/v1/mining/pool-blocks/${poolId}/${fromHeight}`);
} else {
return this.httpClient.get<BlockExtended[]>(this.apiBaseUrl + this.apiBasePath +`/api/v1/mining/pool-blocks/${poolId}`);
}
}
}