Fix array conversion

This commit is contained in:
Jake Barnby 2025-11-12 21:54:37 +13:00
parent 46d785bbb8
commit 37f16ef0bb

View file

@ -160,6 +160,10 @@ class Update extends Action
$action = $operation['action'];
$data = $operation['data'];
if ($data instanceof Document) {
$data = $data->getArrayCopy();
}
if (!isset($collections[$collectionId])) {
$collections[$collectionId] = Authorization::skip(
fn () => $dbForProject->getCollection($collectionId)
@ -184,10 +188,6 @@ class Update extends Action
$databaseOperations[$databaseInternalId] = ($databaseOperations[$databaseInternalId] ?? 0) + 1;
}
if ($data instanceof Document) {
$data = $data->getArrayCopy();
}
switch ($action) {
case 'create':
$this->handleCreateOperation($dbForProject, $collectionId, $documentId, $data, $createdAt, $state);