I'm having the following issue when I try to delete a register by axios:
Cannot use 'in' operator to search for 'validateStatus' in {"name_group":"BBBB","UMB":"BS"}
This is my code to delete the register:
export const deleteProduct= async (product) => {
const params = JSON.stringify({
"name_group":product.name_group,
"UMB": product.UMB
});
return await axios.delete("https://anyDomanin.cloud/Inventory/products/", params,{
"headers": {
"content-type": "application/json",
},
});
};
The create, update and get functions work perfectly, but when I delete appears this issue.
Current version of axios: 0.20.0
PD: When I do it by postman delete works, but when I do it by my WebApp doesn't work.
Edit:
I tried this, but also it did not work:
export const deleteProduct= async (product) => {
const params = JSON.stringify({
"name_group":product.name_group,
"UMB": product.UMB
});
const config = {
headers: {
"content-type": "application/json",
},
body: params
}
return await axios.delete("https://anyDomanin.cloud/Inventory/products/", config);
};