mirror of https://github.com/pixelfed/pixelfed.git
Update unfollow api endpoint to only decrement when appropriate, fixes #3539
This commit is contained in:
parent
7863120292
commit
44de1ad748
|
@ -753,7 +753,9 @@ class ApiV1Controller extends Controller
|
||||||
abort(400, 'You can only follow or unfollow ' . Follower::FOLLOW_PER_HOUR . ' users per hour');
|
abort(400, 'You can only follow or unfollow ' . Follower::FOLLOW_PER_HOUR . ' users per hour');
|
||||||
}
|
}
|
||||||
|
|
||||||
$user->profile->decrement('following_count');
|
if($user->profile->following_count) {
|
||||||
|
$user->profile->decrement('following_count');
|
||||||
|
}
|
||||||
|
|
||||||
FollowRequest::whereFollowerId($user->profile_id)
|
FollowRequest::whereFollowerId($user->profile_id)
|
||||||
->whereFollowingId($target->id)
|
->whereFollowingId($target->id)
|
||||||
|
|
Loading…
Reference in New Issue