1
0
Fork 0
forked from mirror/pixelfed

Update CollectionController, fix null bug

This commit is contained in:
Daniel Supernault 2020-02-18 00:36:49 -07:00
parent c568d54893
commit a84ff19451
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -50,13 +50,13 @@ class CollectionController extends Controller
return $request->all(); return $request->all();
} }
public function store(Request $request, int $id) public function store(Request $request, $id)
{ {
abort_if(!Auth::check(), 403); abort_if(!Auth::check(), 403);
$this->validate($request, [ $this->validate($request, [
'title' => 'nullable', 'title' => 'nullable',
'description' => 'nullable', 'description' => 'nullable',
'visibility' => 'required|alpha|in:public,private' 'visibility' => 'nullable|string|in:public,private'
]); ]);
$profile = Auth::user()->profile; $profile = Auth::user()->profile;
@ -140,7 +140,7 @@ class CollectionController extends Controller
return 200; return 200;
} }
public function get(Request $request, int $id) public function get(Request $request, $id)
{ {
$profile = Auth::check() ? Auth::user()->profile : []; $profile = Auth::check() ? Auth::user()->profile : [];