File tree 1 file changed +7
-6
lines changed
templates/base/http-clients 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -69,17 +69,18 @@ export class HttpClient<SecurityDataType = unknown> {
69
69
this.securityData = data;
70
70
}
71
71
72
+ private encodeQueryParam(key: string, value: any) {
73
+ const encodedKey = encodeURIComponent(key);
74
+ return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`;
75
+ }
76
+
72
77
private addQueryParam(query: QueryParamsType, key: string) {
73
- const value = query[key];
74
- const encodedKey = encodeURIComponent(key);
75
- return `${encodedKey}=${encodeURIComponent(
76
- typeof value === 'number' ? value : `${value}`,
77
- )}`;
78
+ return this.encodeQueryParam(key, query[key]);
78
79
}
79
80
80
81
private addArrayQueryParam(query: QueryParamsType, key: string) {
81
82
const value = query[key];
82
- return `${ value.map(this.addQueryParam) .join('&')}` ;
83
+ return value.map((v: any) => this.encodeQueryParam(key, v)) .join("&") ;
83
84
}
84
85
85
86
protected toQueryString(rawQuery?: QueryParamsType): string {
You can’t perform that action at this time.
0 commit comments