]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/BookController.php
Checked over recycle bin parent/child flows
[bookstack] / app / Http / Controllers / BookController.php
index 2213dedbadd3213227a915895d9a5c4b597ced84..25dc651945363e38140609d54772f78957f684c0 100644 (file)
@@ -114,7 +114,7 @@ class BookController extends Controller
     {
         $book = $this->bookRepo->getBySlug($slug);
         $bookChildren = (new BookContents($book))->getTree(true);
-        $bookParentShelves = $book->shelves()->visible();
+        $bookParentShelves = $book->shelves()->visible()->get();
 
         Views::add($book);
         if ($request->has('shelf')) {
@@ -181,14 +181,13 @@ class BookController extends Controller
     /**
      * Remove the specified book from the system.
      * @throws Throwable
-     * @throws NotifyException
      */
     public function destroy(string $bookSlug)
     {
         $book = $this->bookRepo->getBySlug($bookSlug);
         $this->checkOwnablePermission('book-delete', $book);
 
-        Activity::addMessage('book_delete', $book->name);
+        Activity::add($book, 'book_delete', $book->id);
         $this->bookRepo->destroy($book);
 
         return redirect('/books');