Skip to content

Commit

Permalink
[typescript-angular] Fix undefined query param (OpenAPITools#9657)
Browse files Browse the repository at this point in the history
  • Loading branch information
djnalluri authored Jun 3, 2021
1 parent 93880a4 commit 972ad56
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,16 @@ export class {{classname}} {
{{/hasSomeFormParams}}

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) {
httpParams = this.addToHttpParamsRecursive(httpParams, value);
} else {
httpParams = this.addToHttpParamsRecursive(httpParams, value, key);
}
{{/isQueryParamObjectFormatJson}}
return httpParams;
}

Expand Down

0 comments on commit 972ad56

Please sign in to comment.