Created
June 10, 2020 15:11
-
-
Save clemderome/b7232603a2f3969f8f4d1e56e1e0e85d to your computer and use it in GitHub Desktop.
Express 5 DELETE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.delete('/api/movie/:id', (req, res) => { | |
const idMovie = req.params.id | |
connection.query('DELETE FROM movie WHERE id = ?', [idMovie], err => { | |
if (err) { | |
res.status(500).send("Erreur lors de la supression d'un employé"); | |
} else { | |
res.sendStatus(200); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment