1
0
Fork 0
mirror of synced 2024-07-04 06:00:53 +12:00

chore: update team membership deletion

This commit is contained in:
Christy Jacob 2024-01-30 08:42:46 +00:00
parent 3c7fae7843
commit 7b5be4e154

View file

@ -516,8 +516,8 @@ class Deletes extends Action
if ($document->getAttribute('confirm')) { // Count only confirmed members
$teamId = $document->getAttribute('teamId');
$team = $dbForProject->getDocument('teams', $teamId);
if (!$team->isEmpty() && $team->getAttribute('total', 0) > 0) {
$dbForProject->decreaseDocumentAttribute('teams', $teamId, 'total', 1);
if (!$team->isEmpty()) {
$dbForProject->decreaseDocumentAttribute('teams', $teamId, 'total', 1, 0);
}
}
});