mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +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:
parent
473be9284d
commit
93d8f1cfe7
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue