Fix api endpoints

This commit is contained in:
Daniel Supernault 2024-02-09 20:45:10 -07:00
parent e354750808
commit fd7f5dbba1
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -3691,8 +3691,7 @@ class ApiV1Controller extends Controller
*/
public function statusReplies(Request $request, $id)
{
abort_if(!$request->user() || !$request->user()->token(), 403);
abort_unless($request->user()->tokenCan('read'), 403);
abort_if(!$request->user(), 403);
$this->validate($request, [
'limit' => 'int|min:1|max:10',
@ -3788,8 +3787,7 @@ class ApiV1Controller extends Controller
*/
public function statusState(Request $request, $id)
{
abort_if(!$request->user() || !$request->user()->token(), 403);
abort_unless($request->user()->tokenCan('read'), 403);
abort_if(!$request->user(), 403);
$status = Status::findOrFail($id);
$pid = $request->user()->profile_id;