Update src/Appwrite/Databases/TransactionState.php

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Jake Barnby 2025-10-02 23:05:43 +13:00 committed by GitHub
parent 93d8f1cfe7
commit 9813b98133
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -79,7 +79,9 @@ class TransactionState
break;
case 'upsert':
$state[$collectionId][$documentId] = [
$docId = $documentId ?? ($data['$id'] ?? null);
if (!$docId) { break; }
$state[$collectionId][$docId] = [
'action' => 'upsert',
'document' => new Document($data),
'exists' => true