mirror of
https://github.com/appwrite/appwrite
synced 2026-05-05 22:38:37 +00:00
Fix event firing on txn ops
This commit is contained in:
parent
ab5aac00c4
commit
ae21fadf0d
9 changed files with 19 additions and 1 deletions
|
|
@ -152,6 +152,8 @@ class Decrement extends Action
|
|||
);
|
||||
});
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
// Return successful response without actually decrementing
|
||||
$groupId = $this->getGroupId();
|
||||
$mockDocument = new Document([
|
||||
|
|
|
|||
|
|
@ -152,6 +152,8 @@ class Increment extends Action
|
|||
);
|
||||
});
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
// Return successful response without actually incrementing
|
||||
$groupId = $this->getGroupId();
|
||||
$mockDocument = new Document([
|
||||
|
|
|
|||
|
|
@ -150,6 +150,8 @@ class Delete extends Action
|
|||
);
|
||||
});
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
// Return successful response without actually deleting documents
|
||||
$response->dynamic(new Document([
|
||||
$this->getSDKGroup() => [],
|
||||
|
|
|
|||
|
|
@ -174,6 +174,8 @@ class Update extends Action
|
|||
);
|
||||
});
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
// Return successful response without actually updating documents
|
||||
$response->dynamic(new Document([
|
||||
$this->getSDKGroup() => [],
|
||||
|
|
|
|||
|
|
@ -149,6 +149,8 @@ class Upsert extends Action
|
|||
);
|
||||
});
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
// Return successful response without actually upserting documents
|
||||
$response->dynamic(new Document([
|
||||
$this->getSDKGroup() => [],
|
||||
|
|
|
|||
|
|
@ -412,6 +412,8 @@ class Create extends Action
|
|||
);
|
||||
});
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
// Return successful response without actually creating documents
|
||||
if ($isBulk) {
|
||||
$response->dynamic(new Document([
|
||||
|
|
|
|||
|
|
@ -176,6 +176,8 @@ class Delete extends Action
|
|||
);
|
||||
});
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
// Return successful response without actually deleting document
|
||||
$response->noContent();
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -243,7 +243,6 @@ class Update extends Action
|
|||
->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, max($operations, 1))
|
||||
->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations);
|
||||
|
||||
|
||||
// Handle transaction staging
|
||||
if ($transactionId !== null) {
|
||||
$transaction = ($isAPIKey || $isPrivilegedUser)
|
||||
|
|
@ -302,6 +301,9 @@ class Update extends Action
|
|||
...$document->getArrayCopy(),
|
||||
...$data
|
||||
]);
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
$response
|
||||
->setStatusCode(SwooleResponse::STATUS_CODE_OK)
|
||||
->dynamic($mockDocument, $this->getResponseModel());
|
||||
|
|
|
|||
|
|
@ -302,6 +302,8 @@ class Upsert extends Action
|
|||
);
|
||||
});
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
// Return successful response without actually upserting document
|
||||
$groupId = $this->getGroupId();
|
||||
$mockDocument = new Document([
|
||||
|
|
|
|||
Loading…
Reference in a new issue