mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 16:53:17 +00:00
Update unfollow api endpoint to only decrement when appropriate, fixes #3539
This commit is contained in:
parent
7863120292
commit
44de1ad748
1 changed files with 3 additions and 1 deletions
|
@ -753,7 +753,9 @@ class ApiV1Controller extends Controller
|
|||
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)
|
||||
->whereFollowingId($target->id)
|
||||
|
|
Loading…
Reference in a new issue