1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2025-01-03 05:34:14 +00:00

Update LikeController, fix likes_count bug

This commit is contained in:
Daniel Supernault 2020-04-26 23:13:39 -06:00
parent b355b98a9f
commit 996866cbac
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -27,7 +27,7 @@ class LikeController extends Controller
$profile = $user->profile;
$status = Status::findOrFail($request->input('item'));
$count = $status->likes_count;
$count = $status->likes()->count();
if ($status->likes()->whereProfileId($profile->id)->count() !== 0) {
$like = Like::whereProfileId($profile->id)->whereStatusId($status->id)->firstOrFail();