X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/ee7e1122d325b1807f993e4f0cacc40fbbc806fb..refs/pull/3043/head:/app/Entities/Repos/BookshelfRepo.php diff --git a/app/Entities/Repos/BookshelfRepo.php b/app/Entities/Repos/BookshelfRepo.php index 7cd333ff3..3146c7cba 100644 --- a/app/Entities/Repos/BookshelfRepo.php +++ b/app/Entities/Repos/BookshelfRepo.php @@ -1,9 +1,11 @@ -with('visibleBooks') + ->with(['visibleBooks', 'cover']) ->orderBy($sort, $order) ->paginate($count); } @@ -90,6 +91,7 @@ class BookshelfRepo $this->baseRepo->create($shelf, $input); $this->updateBooks($shelf, $bookIds); Activity::addForEntity($shelf, ActivityType::BOOKSHELF_CREATE); + return $shelf; } @@ -105,6 +107,7 @@ class BookshelfRepo } Activity::addForEntity($shelf, ActivityType::BOOKSHELF_UPDATE); + return $shelf; } @@ -121,7 +124,8 @@ class BookshelfRepo $syncData = Book::visible() ->whereIn('id', $bookIds) - ->get(['id'])->pluck('id')->mapWithKeys(function ($bookId) use ($numericIDs) { + ->pluck('id') + ->mapWithKeys(function ($bookId) use ($numericIDs) { return [$bookId => ['order' => $numericIDs->search($bookId)]]; }); @@ -130,6 +134,7 @@ class BookshelfRepo /** * Update the given shelf cover image, or clear it. + * * @throws ImageUploadException * @throws Exception */ @@ -138,14 +143,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. */ @@ -173,6 +170,7 @@ class BookshelfRepo /** * Remove a bookshelf from the system. + * * @throws Exception */ public function destroy(Bookshelf $shelf)