Advertisement
Guest User

RDHGF

a guest
Jul 28th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. router.route('/deletePictureLog/:picture_id')
  2.     .post(upload.array(), function(req, res) {
  3.         picture_id = req.params.picture_id;
  4.  
  5.         connection.query("DELETE FROM picture WHERE id = ?", [picture_id], function(error, results, fields) {
  6.             if (error)
  7.                 res.json({
  8.                     status: 500,
  9.                     error: error
  10.                 });
  11.             connection.query("DELETE FROM log WHERE picture_id = ?", [picture_id], function(error, results, fields) {
  12.             if (error)
  13.                 res.json({
  14.                     status: 500,
  15.                     error: error
  16.                 });
  17.             res.json({
  18.                 status: 200,
  19.                 message: "LOG_PICTURE_DELETED"
  20.             });
  21.         });
  22.         });
  23.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement