X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/83d77d516665c41ca445a93119dfd97311bfb498..refs/pull/2510/head:/app/Http/Controllers/Api/BookshelfApiController.php diff --git a/app/Http/Controllers/Api/BookshelfApiController.php b/app/Http/Controllers/Api/BookshelfApiController.php index c4851b003..57461fce5 100644 --- a/app/Http/Controllers/Api/BookshelfApiController.php +++ b/app/Http/Controllers/Api/BookshelfApiController.php @@ -43,7 +43,7 @@ class BookshelfApiController extends ApiController { $shelves = Bookshelf::visible(); return $this->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', ]); } @@ -70,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']); }