Skip to content

Commit

Permalink
Filter out unpublished selectors and loan objects from API [MA-160]
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhiltri committed Mar 1, 2024
1 parent ca373b9 commit 5ba64d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Http/Controllers/Api/Objects.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public function __invoke()
$loanObjects = $selectorRepository
->getBaseModel()
->newQuery()
->visible()
->published()
->with(['object']) // This can only preload the LoanObjects
->whereExists($publishedStops)
->get()
Expand All @@ -36,6 +38,8 @@ public function __invoke()
$collectionObjectIds = $selectorRepository
->getBaseModel()
->newQuery()
->visible()
->published()
->whereExists($publishedStops)
->where('object_type', 'collectionObject')
->get()
Expand Down

0 comments on commit 5ba64d4

Please sign in to comment.