From b3ba48a22ce966e62cfad1671e4ee6f4357bb69f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 11 Jan 2018 13:55:55 +0100 Subject: move file api, debug flag on url to show ids --- bucky/app/api.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'bucky/app/api.js') diff --git a/bucky/app/api.js b/bucky/app/api.js index a8149d0..44c4982 100644 --- a/bucky/app/api.js +++ b/bucky/app/api.js @@ -169,6 +169,26 @@ function route (app){ function(req, res){ res.json({ comment: res.comment }) }) + // move a file to another thread + app.get("/api/file/:id/move/:thread_id", + middleware.ensureAuthenticated, + bucky.checkIsAdmin, + bucky.ensureFile, + bucky.ensureThreadById, + bucky.moveFile, + function(req, res){ + res.json({ file: res.file }) + }) + // move a comment to another thread + app.get("/api/comment/:id/move/:thread_id", + middleware.ensureAuthenticated, + bucky.checkIsAdmin, + bucky.ensureComment, + bucky.ensureThreadById, + bucky.moveComment, + function(req, res){ + res.json({ comment: res.comment }) + }) // delete a comment app.delete("/api/comment/:id", middleware.ensureAuthenticated, -- cgit v1.2.3-70-g09d2