SHARE
TWEET

Express Test 4 Delete & Postman

a guest Dec 3rd, 2019 122 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app.delete('/api/movies/:id', (req, res) => {
  2.  
  3.   const id = req.params.id;
  4.  
  5.   connection.query('DELETE FROM movie WHERE id = ?', [id], err => {
  6.     if (err) {
  7.        console.log(err);
  8.       res.status(500).send("Error deleting a movie");
  9.     } else {
  10.       res.sendStatus(200);
  11.     }
  12.   });
  13. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top