From b7efefa40fa3352c6b48ab60064db20978e62aae Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 29 May 2021 13:02:26 +0530 Subject: [PATCH] fix(teams): added comment --- app/controllers/api/teams.php | 2 +- app/workers/deletes.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 ])); } }