Update src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Update.php

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Jake Barnby 2025-10-04 01:15:53 +13:00 committed by GitHub
parent deb3d75375
commit e93e03c248
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -591,8 +591,9 @@ class Update extends Action
}
// Use timestamp wrapper for independent operations
$dbForProject->withRequestTimestamp($createdAt, function () use ($dbForProject, $collectionId, $documentId, $data) {
$dbForProject->decreaseDocumentAttribute(
// Use timestamp wrapper for independent operations
$dbForProject->withRequestTimestamp($createdAt, function () use ($dbForProject, $collectionId, $documentId, $data, &$state) {
$state[$collectionId][$documentId] = $dbForProject->decreaseDocumentAttribute(
collection: $collectionId,
id: $documentId,
attribute: $data[$this->getAttributeKey()],