From 7dfbe3a51ca8c5dfb7bd457dc09c6914ef7f6fc7 Mon Sep 17 00:00:00 2001 From: LSmyrnaios Date: Mon, 20 Feb 2023 19:06:43 +0200 Subject: [PATCH] Fix malformed url, when requesting data from the "getJobsOfUser" endpoint. Previously, the url had its parameters starting with "&", instead of "?". The "offset"-param which was prepended with "?" was not the first param of the url! --- src/app/services/monitor.service.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/services/monitor.service.ts b/src/app/services/monitor.service.ts index c9ccbbe80..2c3dc1095 100755 --- a/src/app/services/monitor.service.ts +++ b/src/app/services/monitor.service.ts @@ -30,11 +30,10 @@ export class MonitorService { getJobsOfUser(params: URLParameter[]): Observable { let url = `${this.apiUrl}getJobsOfUser`; - for (const param of params) { - if (param.key === 'offset') { - url += `?${param.key}=${param.value[0]}`; - } else { - url += `&${param.key}=${param.value[0]}`; + if ( params.length > 0 ) { + url += `?` + for (const param of params) { + url += `${param.key}=${param.value[0]}&`; // An ending "&" in the url does no cause any issues. } } console.log(`knocking on: ${url}`);