mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Update src/Appwrite/Databases/TransactionState.php
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
473be9284d
commit
93d8f1cfe7
1 file changed
+3
-3
@@ -49,15 +49,15 @@ class TransactionState
|
||||
|
||||
switch ($action) {
|
||||
case 'create':
|
||||
if ($documentId) {
|
||||
$state[$collectionId][$documentId] = [
|
||||
$docId = $documentId ?? ($data['$id'] ?? null);
|
||||
if ($docId) {
|
||||
$state[$collectionId][$docId] = [
|
||||
'action' => 'create',
|
||||
'document' => new Document($data),
|
||||
'exists' => true
|
||||
];
|
||||
}
|
||||
break;
|
||||
|
||||
case 'update':
|
||||
if (isset($state[$collectionId][$documentId])) {
|
||||
// Update existing document in transaction state
|
||||
|
||||
Reference in new issue
Block a user