Skip to content

Commit

Permalink
Fix problems with testnet env.
Browse files Browse the repository at this point in the history
* BackendService generates urls such as 'http://example.com//api/blocks', but these url doesnt work with AWS ALB
* BackendService.getBlocks did not use page/perPage parameters
  • Loading branch information
Yamaguchi committed Apr 30, 2024
1 parent ce8a683 commit 525e508
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions frontend/src/app/backend.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ export class BackendService {
constructor(private http: HttpClient, private configService: ConfigService) {}

getBlocks(page: number, perPage: number): Observable<any> {
return this.request('/api/blocks');
return this.request(
'/api/blocks',
new HttpParams({
fromObject: { page: page.toString(), perPage: perPage.toString() }
})
);
}

searchBlock(query: string): Observable<any> {
Expand Down Expand Up @@ -108,7 +113,7 @@ export class BackendService {
private request(url: string, params?: HttpParams): Observable<any> {
return this.getConfig().pipe(
mergeMap((config: Config) => {
return this.http.get(`${config.backendUrl}/${url}`, { params });
return this.http.get(`${config.backendUrl}${url}`, { params });
})
);
}
Expand Down

0 comments on commit 525e508

Please sign in to comment.