#47 - Adds functionality to delete a comment. Also reduces the number of watchers.

This commit is contained in:
Abijeet
2017-06-04 18:52:44 +05:30
parent 2fd421b115
commit 9558f84b97
6 changed files with 147 additions and 15 deletions

View File

@ -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
]);
}