mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-25 01:05:36 +00:00
Update CollectionController
This commit is contained in:
parent
5ec25204ca
commit
ab2d1315a0
1 changed files with 10 additions and 0 deletions
|
@ -175,6 +175,11 @@ class CollectionController extends Controller
|
|||
{
|
||||
$user = $request->user();
|
||||
$collection = CollectionService::getCollection($id);
|
||||
|
||||
if(!$collection) {
|
||||
return response()->json([], 404);
|
||||
}
|
||||
|
||||
if($collection['published_at'] == null || $collection['visibility'] != 'public') {
|
||||
abort_unless($user, 404);
|
||||
if($user->profile_id != $collection['pid']) {
|
||||
|
@ -192,6 +197,11 @@ class CollectionController extends Controller
|
|||
{
|
||||
$user = $request->user();
|
||||
$collection = CollectionService::getCollection($id);
|
||||
|
||||
if(!$collection) {
|
||||
return response()->json([], 404);
|
||||
}
|
||||
|
||||
if($collection['published_at'] == null || $collection['visibility'] != 'public') {
|
||||
abort_unless($user, 404);
|
||||
if($user->profile_id != $collection['pid']) {
|
||||
|
|
Loading…
Reference in a new issue