]> BookStack Code Mirror - bookstack/blobdiff - app/Activity/CommentRepo.php
Comments: Split tests, added extra archive/reference tests
[bookstack] / app / Activity / CommentRepo.php
index bf162f68ae60dfd7f76aa8d376b8911e0cef7cb5..c194e72168ca09d2f52601fdd8ac7c9ee38cc343 100644 (file)
@@ -62,7 +62,7 @@ class CommentRepo
     public function archive(Comment $comment): Comment
     {
         if ($comment->parent_id) {
-            throw new NotifyException('Only top-level comments can be archived.');
+            throw new NotifyException('Only top-level comments can be archived.', '/', 400);
         }
 
         $comment->archived = true;
@@ -79,7 +79,7 @@ class CommentRepo
     public function unarchive(Comment $comment): Comment
     {
         if ($comment->parent_id) {
-            throw new NotifyException('Only top-level comments can be un-archived.');
+            throw new NotifyException('Only top-level comments can be un-archived.', '/', 400);
         }
 
         $comment->archived = false;