mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-06 02:24:33 +08:00
#47 - Adds functionality to delete a comment. Also reduces the number of watchers.
This commit is contained in:
@ -67,6 +67,14 @@ class CommentController extends Controller
|
||||
public function destroy($id) {
|
||||
$comment = $this->comment->findOrFail($id);
|
||||
$this->checkOwnablePermission('comment-delete', $comment);
|
||||
$this->commentRepo->delete($comment);
|
||||
$comment = $this->commentRepo->getCommentById($comment->id);
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => trans('entities.comment_deleted'),
|
||||
'comment' => $comment
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user