1
0
Fork 0
mirror of synced 2024-06-29 19:50:26 +12:00

Merge remote-tracking branch 'origin/feat-list-endpoints-queries' into feat-variables-api

This commit is contained in:
Matej Bačo 2022-08-29 10:08:44 +00:00
commit 79eb351381
2 changed files with 6 additions and 6 deletions

View file

@ -1979,9 +1979,9 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents')
} }
// Validate queries // Validate queries
$validator = new Documents($collection->getAttribute('attributes'), $collection->getAttribute('indexes')); $queriesValidator = new Documents($collection->getAttribute('attributes'), $collection->getAttribute('indexes'));
$valid = $validator->isValid($queries); $validQueries = $queriesValidator->isValid($queries);
if (!$valid) { if (!$validQueries) {
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, $validator->getDescription()); throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, $validator->getDescription());
} }

View file

@ -984,7 +984,7 @@ trait UsersBase
'content-type' => 'application/json', 'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [ ], $this->getHeaders()), [
'queries' => [ 'limit(1)' ] 'queries' => [ 'limit(1)' ],
]); ]);
$this->assertEquals($logs['headers']['status-code'], 200); $this->assertEquals($logs['headers']['status-code'], 200);
@ -996,7 +996,7 @@ trait UsersBase
'content-type' => 'application/json', 'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [ ], $this->getHeaders()), [
'queries' => [ 'offset(1)' ] 'queries' => [ 'offset(1)' ],
]); ]);
$this->assertEquals($logs['headers']['status-code'], 200); $this->assertEquals($logs['headers']['status-code'], 200);
@ -1007,7 +1007,7 @@ trait UsersBase
'content-type' => 'application/json', 'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [ ], $this->getHeaders()), [
'queries' => [ 'limit(1)', 'offset(1)' ] 'queries' => [ 'limit(1)', 'offset(1)' ],
]); ]);
$this->assertEquals($logs['headers']['status-code'], 200); $this->assertEquals($logs['headers']['status-code'], 200);