[typescript-angular] Fix undefined query param (#9657)

This commit is contained in:
Dheeraj Nalluri 2021-06-03 00:58:53 -05:00 committed by GitHub
parent 93880a486e
commit 972ad566fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}