Skip to content

Commit de8f8aa

Browse files
committed
fix delete method string
1 parent 0ce0495 commit de8f8aa

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-use-fetch-api",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "React hook for making simple JSON API requests using the browser Fetch API",
55
"author": "Mercedes Bernard",
66
"repository": {

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const GET = "GET";
22
const POST = "POST";
33
const PUT = "PUT";
4-
const DEL = "DEL";
4+
const DEL = "DELETE";
55

66
async function fetchData(url, method, data) {
77
const response = await fetch(url, {

test/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ describe("useApi", () => {
368368
expect(global.fetch).toHaveBeenCalledWith(
369369
url,
370370
expect.objectContaining({
371-
method: "DEL",
371+
method: "DELETE",
372372
body: null,
373373
headers: headers
374374
})

0 commit comments

Comments
 (0)