From dd8d8c828998fc62aad253bcb296174aee4a2aa0 Mon Sep 17 00:00:00 2001 From: Ajit Singh Date: Sat, 18 Jul 2020 17:28:37 +0530 Subject: [PATCH] fix(common): add `params` and `reportProgress` options to `HttpClient.put()` overload (#37873) When the response type is JSON, the `put()` overload signature did not have `reportProgress` and `params` options. This makes it difficult to type-check this overload. This commit adds them to the overload signature. Fixes #23600 PR Close #37873 --- goldens/public-api/common/http/http.d.ts | 4 ++++ packages/common/http/src/client.ts | 2 ++ 2 files changed, 6 insertions(+) diff --git a/goldens/public-api/common/http/http.d.ts b/goldens/public-api/common/http/http.d.ts index dc83116d82..668d6c76a7 100644 --- a/goldens/public-api/common/http/http.d.ts +++ b/goldens/public-api/common/http/http.d.ts @@ -1177,6 +1177,10 @@ export declare class HttpClient { [header: string]: string | string[]; }; observe: 'events'; + params?: HttpParams | { + [param: string]: string | string[]; + }; + reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; diff --git a/packages/common/http/src/client.ts b/packages/common/http/src/client.ts index 785a229802..ec2dbb64df 100644 --- a/packages/common/http/src/client.ts +++ b/packages/common/http/src/client.ts @@ -2448,6 +2448,8 @@ export class HttpClient { */ put(url: string, body: any|null, options: { headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'events', + params?: HttpParams|{[param: string]: string | string[]}, + reportProgress?: boolean, responseType?: 'json', withCredentials?: boolean, }): Observable>;