I've encountered an issue where I am attempting to pass the page number and page size values to a web API, but for some reason, no parameters are being passed. I have thoroughly debugged the application in VS Code, and verified that the pagingModel object contains both pageSize and pageNumber with valid values. However, when checking the request URL in Chrome dev tools, there are no parameters present. Do you see any potential errors in my code?
getTasks(pagingModel: IPagingModel): Promise<TaskList> {
const url = this.taskUrl;
const params = new URLSearchParams();
let option: RequestOptions;
// tslint:disable-next-line:forin
for (const key in pagingModel) {
params.set(key, pagingModel[key]);
}
option = new RequestOptions( {search: params, params: params});
return this.http.get(url, option)
.toPromise()
.then(response => response.json() as TaskList)
.catch(this.handleError);
}