Skip to content

Commit

Permalink
fix(API): don't send Content-Type in headers when posting formdata. ref
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Jun 4, 2024
1 parent 5a6af2f commit 98fb2e3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/services/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default {
return fetch(url, {
method: 'POST',
body: formData,
headers: DEFAULT_HEADERS
headers: {}
})
.then((response) => response.json())
},
Expand All @@ -44,12 +44,13 @@ export default {
let formData = new FormData()
formData.append('file', proofImage, proofImage.name)
formData.append('type', type)
const url = `${import.meta.env.VITE_OPEN_PRICES_API_URL}/proofs/upload?${buildURLParams()}`
// const url = `${import.meta.env.VITE_OPEN_PRICES_API_URL}/proofs/upload?${buildURLParams()}`
const url = `${import.meta.env.VITE_OPEN_PRICES_API_URL}/proofs/upload`
return fetch(url, {
method: 'POST',
headers: Object.assign({}, DEFAULT_HEADERS, {
headers: {
'Authorization': `Bearer ${store.user.token}`
}),
},
body: formData,
})
.then((response) => response.json())
Expand Down

0 comments on commit 98fb2e3

Please sign in to comment.