X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/4360da03d414cc926dde3d79e22e6e35f85838e1..refs/pull/3391/head:/app/Actions/CommentRepo.php diff --git a/app/Actions/CommentRepo.php b/app/Actions/CommentRepo.php index 8121dfc5c..2f2dd658a 100644 --- a/app/Actions/CommentRepo.php +++ b/app/Actions/CommentRepo.php @@ -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; } }