From 2d32904a40d6a96fb97cfe96748a40a184410b86 Mon Sep 17 00:00:00 2001 From: Leandro Costa Date: Fri, 10 Nov 2023 09:07:36 -0300 Subject: [PATCH] =?UTF-8?q?refactor:=20delegando=20os=20parametros=20padr?= =?UTF-8?q?=C3=A3o=20para=20o=20executarRequest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lhisp-oauth-client.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lhisp-oauth-client.ts b/src/lhisp-oauth-client.ts index 174e00a..dfc7649 100644 --- a/src/lhisp-oauth-client.ts +++ b/src/lhisp-oauth-client.ts @@ -146,6 +146,7 @@ export class LhispOauthClient { data, params, contentType = ContentType.APPLICATION_JSON, + ...opt }: ExecutarRequestParams): Promise { try { await this.getAccessToken(); @@ -163,6 +164,7 @@ export class LhispOauthClient { headers, data, params, + ...opt, }); return response.data; @@ -183,7 +185,6 @@ export class LhispOauthClient { async get(opt: ExecutarRequestParams) { return this.executarRequest({ method: "GET", - contentType: opt.contentType || ContentType.APPLICATION_JSON, ...opt, }); } @@ -191,7 +192,6 @@ export class LhispOauthClient { async put(opt: ExecutarRequestParams) { return this.executarRequest({ method: "PUT", - contentType: opt.contentType || ContentType.APPLICATION_JSON, ...opt, }); } @@ -199,7 +199,6 @@ export class LhispOauthClient { async patch(opt: ExecutarRequestParams) { return this.executarRequest({ method: "PATCH", - contentType: opt.contentType || ContentType.APPLICATION_JSON, ...opt, }); } @@ -207,7 +206,6 @@ export class LhispOauthClient { async post(opt: ExecutarRequestParams) { return this.executarRequest({ method: "POST", - contentType: opt.contentType || ContentType.APPLICATION_JSON, ...opt, }); } @@ -215,7 +213,6 @@ export class LhispOauthClient { async delete(opt: ExecutarRequestParams) { return this.executarRequest({ method: "DELETE", - contentType: opt.contentType || ContentType.APPLICATION_JSON, ...opt, }); }