Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exteand deletes worker #8274

Open
wants to merge 16 commits into
base: refactor-usage-sn
Choose a base branch
from
Prev Previous commit
Next Next commit
Delete user update
  • Loading branch information
shimonewman committed Jun 16, 2024
commit 8537e1ce32ae12e7b45e62a6208c2cf2b72a7a1a
3 changes: 0 additions & 3 deletions src/Appwrite/Platform/Workers/Deletes.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,14 +597,11 @@ protected function deleteUser(callable $getProjectDB, Document $document, Docum
$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);
}
}
Expand Down