소스 검색

Update PublicApiController, fix likes bug

Daniel Supernault 4 년 전
부모
커밋
3c1e1f7e87
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  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