From 56282fb2fa96fdd1e3dbe04bcdb370eb1c475d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 29 Aug 2022 09:16:18 +0000 Subject: [PATCH 1/2] Fix users logs test --- tests/e2e/Services/Users/UsersBase.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/e2e/Services/Users/UsersBase.php b/tests/e2e/Services/Users/UsersBase.php index f2e498366..88bb8872e 100644 --- a/tests/e2e/Services/Users/UsersBase.php +++ b/tests/e2e/Services/Users/UsersBase.php @@ -984,7 +984,7 @@ trait UsersBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'limit' => 1 + 'queries' => [ 'limit(1)' ], ]); $this->assertEquals($logs['headers']['status-code'], 200); @@ -996,7 +996,7 @@ trait UsersBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'offset' => 1 + 'queries' => [ 'offset(1)' ], ]); $this->assertEquals($logs['headers']['status-code'], 200); @@ -1007,8 +1007,7 @@ trait UsersBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'offset' => 1, - 'limit' => 1 + 'queries' => [ 'limit(1)', 'offset(1)' ], ]); $this->assertEquals($logs['headers']['status-code'], 200); From 99b95cfb74ab4718c29e14f13b54c88dee9b7536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 29 Aug 2022 10:05:11 +0000 Subject: [PATCH 2/2] Fix bug after merge conflict --- app/controllers/api/databases.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 861766df8..04b6e4e9b 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -1979,9 +1979,9 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') } // Validate queries - $validator = new Documents($collection->getAttribute('attributes'), $collection->getAttribute('indexes')); - $valid = $validator->isValid($queries); - if (!$valid) { + $queriesValidator = new Documents($collection->getAttribute('attributes'), $collection->getAttribute('indexes')); + $validQueries = $queriesValidator->isValid($queries); + if (!$validQueries) { throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, $validator->getDescription()); }