X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/1559b0acd1018edff3f173df0c87f631549462fa..a56a28fbb7eaff40a639c2d06f56de255cd654ea:/app/Entities/Controllers/BookSortController.php diff --git a/app/Entities/Controllers/BookSortController.php b/app/Entities/Controllers/BookSortController.php index 5d7024952..5aefc5832 100644 --- a/app/Entities/Controllers/BookSortController.php +++ b/app/Entities/Controllers/BookSortController.php @@ -22,7 +22,7 @@ class BookSortController extends Controller */ public function show(string $bookSlug) { - $book = $this->queries->findVisibleBySlug($bookSlug); + $book = $this->queries->findVisibleBySlugOrFail($bookSlug); $this->checkOwnablePermission('book-update', $book); $bookChildren = (new BookContents($book))->getTree(false); @@ -38,7 +38,7 @@ class BookSortController extends Controller */ public function showItem(string $bookSlug) { - $book = $this->queries->findVisibleBySlug($bookSlug); + $book = $this->queries->findVisibleBySlugOrFail($bookSlug); $bookChildren = (new BookContents($book))->getTree(); return view('books.parts.sort-box', ['book' => $book, 'bookChildren' => $bookChildren]); @@ -49,7 +49,7 @@ class BookSortController extends Controller */ public function update(Request $request, string $bookSlug) { - $book = $this->queries->findVisibleBySlug($bookSlug); + $book = $this->queries->findVisibleBySlugOrFail($bookSlug); $this->checkOwnablePermission('book-update', $book); // Return if no map sent