From 3c1e1f7e8750bae5b7273bd5e194fab98e352d41 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 31 May 2021 21:49:44 -0600 Subject: [PATCH] Update PublicApiController, fix likes bug --- app/Http/Controllers/PublicApiController.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/PublicApiController.php b/app/Http/Controllers/PublicApiController.php index 1f52f7267..707434661 100644 --- a/app/Http/Controllers/PublicApiController.php +++ b/app/Http/Controllers/PublicApiController.php @@ -199,9 +199,8 @@ class PublicApiController extends Controller public function statusLikes(Request $request, $username, $id) { - $profile = Profile::whereUsername($username)->whereNull('status')->firstOrFail(); - $status = Status::whereProfileId($profile->id)->findOrFail($id); - $this->scopeCheck($profile, $status); + $status = Status::findOrFail($id); + $this->scopeCheck($status->profile, $status); $likes = $this->getLikes($status); return response()->json([ 'data' => $likes