X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/c157dc3490c39aa236e22714019a649ebeb11f13..refs/pull/2522/head:/app/Entities/Repos/BookshelfRepo.php diff --git a/app/Entities/Repos/BookshelfRepo.php b/app/Entities/Repos/BookshelfRepo.php index 2c80b2a7d..649f4b0c4 100644 --- a/app/Entities/Repos/BookshelfRepo.php +++ b/app/Entities/Repos/BookshelfRepo.php @@ -1,9 +1,9 @@ with('visibleBooks') + ->with(['visibleBooks', 'cover']) ->orderBy($sort, $order) ->paginate($count); } @@ -89,7 +88,7 @@ class BookshelfRepo $shelf = new Bookshelf(); $this->baseRepo->create($shelf, $input); $this->updateBooks($shelf, $bookIds); - Activity::add($shelf, ActivityType::BOOKSHELF_CREATE); + Activity::addForEntity($shelf, ActivityType::BOOKSHELF_CREATE); return $shelf; } @@ -104,7 +103,7 @@ class BookshelfRepo $this->updateBooks($shelf, $bookIds); } - Activity::add($shelf, ActivityType::BOOKSHELF_UPDATE); + Activity::addForEntity($shelf, ActivityType::BOOKSHELF_UPDATE); return $shelf; } @@ -138,14 +137,6 @@ class BookshelfRepo $this->baseRepo->updateCoverImage($shelf, $coverImage, $removeImage); } - /** - * Update the permissions of a bookshelf. - */ - public function updatePermissions(Bookshelf $shelf, bool $restricted, Collection $permissions = null) - { - $this->baseRepo->updatePermissions($shelf, $restricted, $permissions); - } - /** * Copy down the permissions of the given shelf to all child books. */ @@ -179,7 +170,7 @@ class BookshelfRepo { $trashCan = new TrashCan(); $trashCan->softDestroyShelf($shelf); - Activity::add($shelf, ActivityType::BOOKSHELF_DELETE); + Activity::addForEntity($shelf, ActivityType::BOOKSHELF_DELETE); $trashCan->autoClearOld(); } }