axios.delete(http://localhost:3001/api/delete/${movie}/${review})
I am passing 2 pieces of information and it is not passing
and in the backend my code is this
app.delete("/api/delete/:movie/:review", (req, res) => {
const name = req.params.movie;
const review = req.params.review;
const sqlDelete =
"DELETE FROM movietable WHERE movienames = ? AND moviereviews = ?";
db.query(sqlDelete, [name, review], (err, results) => {
if (err) {
console.log(err);
res.status(500).send("Error deleting movie review");
} else {
res.status(200).send("Movie review deleted successfully");
}
});
});
why it is not deleting from databaseand giving me axios error 404
i am expecting an answer
Muhammad Zubair is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.