1
0
Fork 0
mirror of synced 2024-09-28 07:21:35 +12:00

fix(teams): added comment

This commit is contained in:
Christy Jacob 2021-05-29 13:02:26 +05:30
parent a6db680641
commit b7efefa40f
2 changed files with 2 additions and 2 deletions

View file

@ -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
]));
}

View file

@ -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
]));
}
}