mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +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:
co-authored by
coderabbitai[bot]
parent
473be9284d
commit
93d8f1cfe7
@@ -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