forked from mirror/pixelfed
Update LikeController, fix likes_count bug
This commit is contained in:
parent
b355b98a9f
commit
996866cbac
|
@ -27,7 +27,7 @@ class LikeController extends Controller
|
||||||
$profile = $user->profile;
|
$profile = $user->profile;
|
||||||
$status = Status::findOrFail($request->input('item'));
|
$status = Status::findOrFail($request->input('item'));
|
||||||
|
|
||||||
$count = $status->likes_count;
|
$count = $status->likes()->count();
|
||||||
|
|
||||||
if ($status->likes()->whereProfileId($profile->id)->count() !== 0) {
|
if ($status->likes()->whereProfileId($profile->id)->count() !== 0) {
|
||||||
$like = Like::whereProfileId($profile->id)->whereStatusId($status->id)->firstOrFail();
|
$like = Like::whereProfileId($profile->id)->whereStatusId($status->id)->firstOrFail();
|
||||||
|
|
Loading…
Reference in New Issue