X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/3f7180fa99cbca96f83fcc8d95b3be08adfbb65f..refs/pull/2748/head:/app/Http/Controllers/Api/BookshelfApiController.php diff --git a/app/Http/Controllers/Api/BookshelfApiController.php b/app/Http/Controllers/Api/BookshelfApiController.php index 6792f9f45..4ce93defa 100644 --- a/app/Http/Controllers/Api/BookshelfApiController.php +++ b/app/Http/Controllers/Api/BookshelfApiController.php @@ -1,7 +1,7 @@ apiListingResponse($shelves, [ - 'id', 'name', 'slug', 'description', 'created_at', 'updated_at', 'created_by', 'updated_by', 'image_id', + 'id', 'name', 'slug', 'description', 'created_at', 'updated_at', 'created_by', 'updated_by', 'owned_by', 'image_id', ]); } @@ -71,7 +70,7 @@ class BookshelfApiController extends ApiController public function read(string $id) { $shelf = Bookshelf::visible()->with([ - 'tags', 'cover', 'createdBy', 'updatedBy', + 'tags', 'cover', 'createdBy', 'updatedBy', 'ownedBy', 'books' => function (BelongsToMany $query) { $query->visible()->get(['id', 'name', 'slug']); } @@ -101,7 +100,8 @@ class BookshelfApiController extends ApiController /** - * Delete a single shelf from the system. + * Delete a single shelf. + * This will typically send the shelf to the recycle bin. * @throws Exception */ public function delete(string $id) @@ -112,4 +112,4 @@ class BookshelfApiController extends ApiController $this->bookshelfRepo->destroy($shelf); return response('', 204); } -} \ No newline at end of file +}