Skip to content

Commit

Permalink
fix delete method string
Browse files Browse the repository at this point in the history
  • Loading branch information
mercedesb committed Mar 1, 2020
1 parent 0ce0495 commit de8f8aa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-use-fetch-api",
"version": "1.0.3",
"version": "1.0.4",
"description": "React hook for making simple JSON API requests using the browser Fetch API",
"author": "Mercedes Bernard",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const GET = "GET";
const POST = "POST";
const PUT = "PUT";
const DEL = "DEL";
const DEL = "DELETE";

async function fetchData(url, method, data) {
const response = await fetch(url, {
Expand Down
2 changes: 1 addition & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ describe("useApi", () => {
expect(global.fetch).toHaveBeenCalledWith(
url,
expect.objectContaining({
method: "DEL",
method: "DELETE",
body: null,
headers: headers
})
Expand Down

0 comments on commit de8f8aa

Please sign in to comment.