From 23e04c0cc034ea86095674e050b6da3c01c0a6c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Felipe=20Schulle?= Date: Wed, 15 May 2024 14:12:57 -0300 Subject: [PATCH] =?UTF-8?q?fix(delete-method):=20corre=C3=A7=C3=A3o=20body?= =?UTF-8?q?=20undefined=20ao=20fazer=20requisi=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/lib/fetch-wrapper.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2fbf38d..38b1b1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@brainylab/fetch-wrapper", - "version": "0.3.3", + "version": "0.3.4", "main": "./index.js", "module": "./index.mjs", "types": "./index.d.ts", diff --git a/src/lib/fetch-wrapper.ts b/src/lib/fetch-wrapper.ts index d864fcf..f23bb12 100644 --- a/src/lib/fetch-wrapper.ts +++ b/src/lib/fetch-wrapper.ts @@ -76,7 +76,8 @@ export class FetchWrapper implements FetchMethods { ? mergeConfigs(this.defaults, init) : (this.defaults as RequestInit); - if (['GET', 'HEAD'].includes(configs.method)) configs.body = undefined; + if (['GET', 'HEAD', 'DELETE'].includes(configs.method)) + configs.body = undefined; const response = await fetch(url, configs);