Browse Source

Update PublicApiController, fix likes bug

Daniel Supernault 4 years ago
parent
commit
3c1e1f7e87
1 changed files with 2 additions and 3 deletions
  1. 2 3
      app/Http/Controllers/PublicApiController.php

+ 2 - 3
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