diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 88b893341b..e2e270cd20 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -784,7 +784,7 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') if ($membership->getAttribute('confirm')) { // Count only confirmed members $team = $projectDB->updateDocument(\array_merge($team->getArrayCopy(), [ - 'sum' => \max($team->getAttribute('sum', 0) - 1, 0), + 'sum' => \max($team->getAttribute('sum', 0) - 1, 0), // Ensure that sum is always >= 0 ])); } diff --git a/app/workers/deletes.php b/app/workers/deletes.php index 949733916d..6e20a6528c 100644 --- a/app/workers/deletes.php +++ b/app/workers/deletes.php @@ -138,7 +138,7 @@ class DeletesV1 $team = $this->getProjectDB($projectId)->getDocument($teamId); if(!$team->isEmpty()) { $team = $this->getProjectDB($projectId)->updateDocument(\array_merge($team->getArrayCopy(), [ - 'sum' => \max($team->getAttribute('sum', 0) - 1, 0), + 'sum' => \max($team->getAttribute('sum', 0) - 1, 0), // Ensure that sum is always >= 0 ])); } }