]> BookStack Code Mirror - bookstack/blobdiff - app/Actions/CommentRepo.php
Fixed failing webhook test cases
[bookstack] / app / Actions / CommentRepo.php
index 8121dfc5cf807b2fb95c2d714e9e7203c7480314..2f2dd658a3c754294e8e45735ba183c5e2cc4d55 100644 (file)
@@ -45,7 +45,7 @@ class CommentRepo
         $comment->parent_id = $parent_id;
 
         $entity->comments()->save($comment);
-        ActivityService::addForEntity($entity, ActivityType::COMMENTED_ON);
+        ActivityService::add(ActivityType::COMMENTED_ON, $entity);
 
         return $comment;
     }
@@ -90,8 +90,9 @@ class CommentRepo
      */
     protected function getNextLocalId(Entity $entity): int
     {
-        $comments = $entity->comments(false)->orderBy('local_id', 'desc')->first();
+        /** @var Comment $comment */
+        $comment = $entity->comments(false)->orderBy('local_id', 'desc')->first();
 
-        return ($comments->local_id ?? 0) + 1;
+        return ($comment->local_id ?? 0) + 1;
     }
 }