1
0
Fork 0
mirror of synced 2024-09-29 08:51:28 +13:00

Delete user update

This commit is contained in:
shimon 2024-06-16 16:43:09 +03:00
parent 8520a66fd9
commit 8537e1ce32

View file

@ -597,14 +597,11 @@ class Deletes extends Action
$team = $dbForProject->getDocument('teams', $teamId);
if (!$team->isEmpty()) {
$total = $document->getAttribute('total');
var_dump('$total='.$total);
// Delete the team if the user is the last membership
if ($total === 1) {
var_dump('Deleting team');
$this->deleteById($team, $dbForProject);
return;
}
var_dump('decrease total');
$dbForProject->decreaseDocumentAttribute('teams', $teamId, 'total', 1, 0);
}
}