Skip to content

Commit

Permalink
label url encoding (#82)
Browse files Browse the repository at this point in the history
Co-authored-by: Ludek Novy <[email protected]>
  • Loading branch information
ludeknovy and nvldk authored Oct 2, 2020
1 parent 0b928f2 commit 3b1fe0d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/app/label-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<LabelTrend>(
`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<LabelMaxVu>(`projects/${projectName}/scenarios/${scenarioName}/items/${itemId}/label/${label}/virtual-users`, { params });
return this.http.get<LabelMaxVu>(`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`);

}
}

0 comments on commit 3b1fe0d

Please sign in to comment.