mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 22:50:53 +00:00
[typescript-angular] Fix undefined query param (#9657)
This commit is contained in:
parent
93880a486e
commit
972ad566fe
@ -93,11 +93,16 @@ export class {{classname}} {
|
|||||||
{{/hasSomeFormParams}}
|
{{/hasSomeFormParams}}
|
||||||
|
|
||||||
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
|
private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams {
|
||||||
|
{{#isQueryParamObjectFormatJson}}
|
||||||
|
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
|
||||||
|
{{/isQueryParamObjectFormatJson}}
|
||||||
|
{{^isQueryParamObjectFormatJson}}
|
||||||
if (typeof value === "object" && value instanceof Date === false) {
|
if (typeof value === "object" && value instanceof Date === false) {
|
||||||
httpParams = this.addToHttpParamsRecursive(httpParams, value);
|
httpParams = this.addToHttpParamsRecursive(httpParams, value);
|
||||||
} else {
|
} else {
|
||||||
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
|
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
|
||||||
}
|
}
|
||||||
|
{{/isQueryParamObjectFormatJson}}
|
||||||
return httpParams;
|
return httpParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user