Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
fix(delete-method): correção body undefined ao fazer requisição
Browse files Browse the repository at this point in the history
  • Loading branch information
andrefelipeschulle committed May 15, 2024
1 parent 60b6c5d commit 23e04c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/lib/fetch-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 23e04c0

Please sign in to comment.