From 7b5be4e154fa469500c81ac28dd320bda906409e Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 30 Jan 2024 08:42:46 +0000 Subject: [PATCH] chore: update team membership deletion --- src/Appwrite/Platform/Workers/Deletes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Deletes.php b/src/Appwrite/Platform/Workers/Deletes.php index b5b2d82025..96cb2d80cf 100644 --- a/src/Appwrite/Platform/Workers/Deletes.php +++ b/src/Appwrite/Platform/Workers/Deletes.php @@ -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); } } });