I have axios PUT method in API and it's got Unhandled Runtime Error
Error: Request failed with status code 500
update: async (article, pid, token) => {
const { data, status } = await axios.put(
`${apiPath}/articles/${pid}`,
JSON.stringify({ article }),
{
headers: {
'Content-Type': 'application/json',
Authorization: `Token ${encodeURIComponent(token)}`,
},
}
)
return {
data,
status,
}
},
But for POST method it working real fine, so I'm in very deep confusion
create: async (article, token) => {
const { data, status } = await axios.post(
`${apiPath}/articles`,
JSON.stringify({ article }),
{
headers: {
'Content-Type': 'application/json',
Authorization: `Token ${encodeURIComponent(token)}`,
},
}
)
return {
data,
status,
}
},
}