Skip to content

Commit

Permalink
fix(headers): add content type for post requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryant Brock committed May 4, 2023
1 parent a39762c commit 26da646
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const ${hookName} = ({ query, options } = {}) => {
modelName
)}/${action}", {
method: "POST",
headers: { "Content-Type": "application/json" },
...(query && { body: JSON.stringify(query) }),
})
.then((res) => res.json())
Expand Down Expand Up @@ -105,6 +106,7 @@ export const ${hookName} = ({
modelName
)}/${action}?" + params, {
method: "POST",
headers: { "Content-Type": "application/json" },
...(query && { body: JSON.stringify(query) }),
})
.then((res) => res.json())
Expand Down Expand Up @@ -152,6 +154,7 @@ export const ${hookName} = () => {
)}/${action}", {
body: JSON.stringify(mutation),
method: "POST",
headers: { "Content-Type": "application/json" },
})
.then((res) => res.json())
.catch()
Expand Down

0 comments on commit 26da646

Please sign in to comment.