Update CollectionController, limit unpublished collections to owner

This commit is contained in:
Daniel Supernault 2022-04-03 03:25:08 -06:00
parent dab9bcaf36
commit a0061eb56c
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -237,6 +237,9 @@ class CollectionController extends Controller
return Collection::whereProfileId($profile->id) return Collection::whereProfileId($profile->id)
->whereIn('visibility', $visibility) ->whereIn('visibility', $visibility)
->when(!$owner, function($q, $owner) {
return $q->whereNotNull('published_at');
})
->orderByDesc('id') ->orderByDesc('id')
->paginate(9) ->paginate(9)
->map(function($collection) { ->map(function($collection) {