2024-03-05 10:20:36 +00:00

21 lines
546 B
JavaScript
Executable File

import deleteComment from "../services/deleteComment"
export default {
method: "DELETE",
route: "/post/:post_id/:comment_id",
middlewares: ["withAuthentication"],
fn: async (req, res) => {
const result = await deleteComment({
comment_id: req.params.comment_id,
issuer_id: req.user._id.toString(),
}).catch((err) => {
res.status(500).json({ message: err.message })
return false
})
if (result) {
return res.json(result)
}
}
}