From 3b1fe0d7d6b44efc8d6976a0cf15796467e9b8db Mon Sep 17 00:00:00 2001 From: Ludek <13610612+ludeknovy@users.noreply.github.com> Date: Fri, 2 Oct 2020 21:00:15 +0200 Subject: [PATCH] label url encoding (#82) Co-authored-by: Ludek Novy --- src/app/label-api.service.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/label-api.service.ts b/src/app/label-api.service.ts index 4aba4c32..19c4351f 100644 --- a/src/app/label-api.service.ts +++ b/src/app/label-api.service.ts @@ -11,17 +11,20 @@ export class LabelApiService { constructor(private http: HttpClient) { } fetchLabelTrend(projectName, scenarioName, itemId, label, params) { + const encodedLabel = encodeURIComponent(label); return this.http.get( - `projects/${projectName}/scenarios/${scenarioName}/items/${itemId}/label/${label}/trend`, { params }); + `projects/${projectName}/scenarios/${scenarioName}/items/${itemId}/label/${encodedLabel}/trend`, { params }); } fetchLabelMaxVu(projectName, scenarioName, itemId, label, params) { + const encodedLabel = encodeURIComponent(label); // tslint:disable-next-line:max-line-length - return this.http.get(`projects/${projectName}/scenarios/${scenarioName}/items/${itemId}/label/${label}/virtual-users`, { params }); + return this.http.get(`projects/${projectName}/scenarios/${scenarioName}/items/${itemId}/label/${encodedLabel}/virtual-users`, { params }); } fetchLabelErrors(projectName, scenarioName, itemId, label) { - return this.http.get<{ stat: any }>(`projects/${projectName}/scenarios/${scenarioName}/items/${itemId}/label/${label}/errors`); + const encodedLabel = encodeURIComponent(label); + return this.http.get<{ stat: any }>(`projects/${projectName}/scenarios/${scenarioName}/items/${itemId}/label/${encodedLabel}/errors`); } }