Skip to content

Commit

Permalink
Fix level listing not correctly calling API
Browse files Browse the repository at this point in the history
jvyden committed Jun 1, 2024
1 parent e3e3f7b commit 231b85a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/app/api/client.service.ts
Original file line number Diff line number Diff line change
@@ -32,8 +32,20 @@ export class ClientService {
return this.setPageQuery(null, skip, count);
}

private convertParamsToHttpParams(params: Params | null): HttpParams | null {
if(params == null) return null;

let httpParams = new HttpParams();

for (let key of Object.keys(params)) {
httpParams = httpParams.set(key, params[key]);
}

return httpParams;
}

private setPageQuery(params: Params | null, skip: number, count: number) {
return params ?? new HttpParams()
return (this.convertParamsToHttpParams(params) ?? new HttpParams())
.set('skip', skip)
.set('count', count);
}

0 comments on commit 231b85a

Please sign in to comment.