mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
add: graphql tests for bulk apis.
This commit is contained in:
-1
@@ -43,7 +43,6 @@ class Upsert extends Action
|
||||
->setHttpPath('/v1/databases/:databaseId/collections/:collectionId/documents')
|
||||
->desc('Create or update documents')
|
||||
->groups(['api', 'database'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].create')
|
||||
->label('scope', 'documents.write')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('audits.event', 'document.create')
|
||||
|
||||
+7
-6
@@ -418,6 +418,13 @@ class Create extends Action
|
||||
|
||||
$response->setStatusCode(SwooleResponse::STATUS_CODE_CREATED);
|
||||
|
||||
// BIG TODO: @itznotabug - need to check what to do for bulk api because there's not just one `[document/rowId]`.
|
||||
$queueForEvents
|
||||
->setParam('documentId', $documents[0]->getId())
|
||||
->setParam('rowId', $documents[0]->getId())
|
||||
// TODO: @itznotabug - check if the events mirroring works here!
|
||||
->setEvent('databases.[databaseId].collections.[collectionId].documents.[documentId].create');
|
||||
|
||||
if ($isBulk) {
|
||||
$response->dynamic(new Document([
|
||||
'total' => count($documents),
|
||||
@@ -427,12 +434,6 @@ class Create extends Action
|
||||
return;
|
||||
}
|
||||
|
||||
$queueForEvents
|
||||
->setParam('documentId', $documents[0]->getId())
|
||||
->setParam('rowId', $documents[0]->getId())
|
||||
// TODO: @itznotabug - check if the events mirroring works here!
|
||||
->setEvent('databases.[databaseId].collections.[collectionId].documents.[documentId].create');
|
||||
|
||||
$response->dynamic(
|
||||
$documents[0],
|
||||
$this->getResponseModel()
|
||||
|
||||
@@ -38,7 +38,6 @@ class Upsert extends DocumentsUpsert
|
||||
->setHttpPath('/v1/databases/:databaseId/tables/:tableId/rows')
|
||||
->desc('Create or update rows')
|
||||
->groups(['api', 'database'])
|
||||
->label('event', 'databases.[databaseId].tables.[tableId].rows.[rowId].create')
|
||||
->label('scope', 'documents.write')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('audits.event', 'row.create')
|
||||
|
||||
Reference in New Issue
Block a user