]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/Controllers/ChapterApiController.php
Merge branch 'chapter-templates' into development
[bookstack] / app / Entities / Controllers / ChapterApiController.php
index 27b8206592d0a32b14742454e48d9d1527f1b0a4..3fbe852220579d2b0ad36b8b7f3237d5338af658 100644 (file)
@@ -136,8 +136,9 @@ class ChapterApiController extends ApiController
         $chapter->unsetRelations()->refresh();
 
         $chapter->load(['tags']);
-        $chapter->makeVisible('description_html')
-            ->setAttribute('description_html', $chapter->descriptionHtml());
+        $chapter->makeVisible('description_html');
+        $chapter->setAttribute('description_html', $chapter->descriptionHtml());
+        $chapter->setAttribute('book_slug', $chapter->book()->first()->slug);
 
         return $chapter;
     }