Skip to content

Commit f171411

Browse files
committed
Fixed queryparms on apiservice
1 parent d84840b commit f171411

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

frontend/src/app/services/api.service.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -603,11 +603,17 @@ export class ApiService {
603603
);
604604
}
605605

606-
getAngorProjectInvestments(angorId: string, from: number, limit: number): Observable<AngorProjectInvestment[]> {
606+
getAngorProjectInvestments(angorId: string, from?: number, limit?: number): Observable<AngorProjectInvestment[]> {
607+
const queryParams = new URLSearchParams();
608+
if (from) {
609+
queryParams.append('offset', from.toString());
610+
}
611+
if (limit) {
612+
queryParams.append('limit', limit.toString());
613+
}
614+
const queryString = queryParams.toString();
607615
return this.httpClient.get<AngorProjectInvestment[]>(
608-
this.apiBaseUrl + this.apiBasePath + '/api/v1/query/Angor/projects/' + angorId + '/investments' +
609-
(from == undefined ? '' : '?offset=' + from) +
610-
(limit == undefined ? '' : '&limit=' + limit)
616+
this.apiBaseUrl + this.apiBasePath + '/api/v1/query/Angor/projects/' + angorId + '/investments/' + queryString
611617
);
612618
}
613619
}

0 commit comments

Comments
 (0)