mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Fix event firing on txn ops
This commit is contained in:
+2
@@ -152,6 +152,8 @@ class Decrement extends Action
|
||||
);
|
||||
});
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
// Return successful response without actually decrementing
|
||||
$groupId = $this->getGroupId();
|
||||
$mockDocument = new Document([
|
||||
|
||||
+2
@@ -152,6 +152,8 @@ class Increment extends Action
|
||||
);
|
||||
});
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
// Return successful response without actually incrementing
|
||||
$groupId = $this->getGroupId();
|
||||
$mockDocument = new Document([
|
||||
|
||||
+2
@@ -150,6 +150,8 @@ class Delete extends Action
|
||||
);
|
||||
});
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
// Return successful response without actually deleting documents
|
||||
$response->dynamic(new Document([
|
||||
$this->getSDKGroup() => [],
|
||||
|
||||
+2
@@ -174,6 +174,8 @@ class Update extends Action
|
||||
);
|
||||
});
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
// Return successful response without actually updating documents
|
||||
$response->dynamic(new Document([
|
||||
$this->getSDKGroup() => [],
|
||||
|
||||
+2
@@ -149,6 +149,8 @@ class Upsert extends Action
|
||||
);
|
||||
});
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
// Return successful response without actually upserting documents
|
||||
$response->dynamic(new Document([
|
||||
$this->getSDKGroup() => [],
|
||||
|
||||
+2
@@ -412,6 +412,8 @@ class Create extends Action
|
||||
);
|
||||
});
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
// Return successful response without actually creating documents
|
||||
if ($isBulk) {
|
||||
$response->dynamic(new Document([
|
||||
|
||||
+2
@@ -176,6 +176,8 @@ class Delete extends Action
|
||||
);
|
||||
});
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
// Return successful response without actually deleting document
|
||||
$response->noContent();
|
||||
return;
|
||||
|
||||
+3
-1
@@ -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());
|
||||
|
||||
+2
@@ -302,6 +302,8 @@ class Upsert extends Action
|
||||
);
|
||||
});
|
||||
|
||||
$queueForEvents->reset();
|
||||
|
||||
// Return successful response without actually upserting document
|
||||
$groupId = $this->getGroupId();
|
||||
$mockDocument = new Document([
|
||||
|
||||
Reference in New Issue
Block a user