mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
21 lines
546 B
JavaScript
Executable File
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)
|
|
}
|
|
}
|
|
} |