Update PublicApiController, fix likes bug

This commit is contained in:
Daniel Supernault 2021-05-31 21:49:44 -06:00
parent 525dce1c59
commit 3c1e1f7e87
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -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