diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index b1374097e5..34df09c7f5 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -820,7 +820,7 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId') } $webhook = $dbForConsole->findOne('webhooks', [ - Query::equal('_uid', [$webhookId]), + Query::equal('$id', [$webhookId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -862,7 +862,7 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId') $security = ($security === '1' || $security === 'true' || $security === 1 || $security === true); $webhook = $dbForConsole->findOne('webhooks', [ - Query::equal('_uid', [$webhookId]), + Query::equal('$id', [$webhookId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -908,7 +908,7 @@ App::patch('/v1/projects/:projectId/webhooks/:webhookId/signature') } $webhook = $dbForConsole->findOne('webhooks', [ - Query::equal('_uid', [$webhookId]), + Query::equal('$id', [$webhookId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -946,7 +946,7 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId') } $webhook = $dbForConsole->findOne('webhooks', [ - Query::equal('_uid', [$webhookId]), + Query::equal('$id', [$webhookId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -1068,7 +1068,7 @@ App::get('/v1/projects/:projectId/keys/:keyId') } $key = $dbForConsole->findOne('keys', [ - Query::equal('_uid', [$keyId]), + Query::equal('$id', [$keyId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -1105,7 +1105,7 @@ App::put('/v1/projects/:projectId/keys/:keyId') } $key = $dbForConsole->findOne('keys', [ - Query::equal('_uid', [$keyId]), + Query::equal('$id', [$keyId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -1148,7 +1148,7 @@ App::delete('/v1/projects/:projectId/keys/:keyId') } $key = $dbForConsole->findOne('keys', [ - Query::equal('_uid', [$keyId]), + Query::equal('$id', [$keyId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -1270,7 +1270,7 @@ App::get('/v1/projects/:projectId/platforms/:platformId') } $platform = $dbForConsole->findOne('platforms', [ - Query::equal('_uid', [$platformId]), + Query::equal('$id', [$platformId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -1307,7 +1307,7 @@ App::put('/v1/projects/:projectId/platforms/:platformId') } $platform = $dbForConsole->findOne('platforms', [ - Query::equal('_uid', [$platformId]), + Query::equal('$id', [$platformId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -1351,7 +1351,7 @@ App::delete('/v1/projects/:projectId/platforms/:platformId') } $platform = $dbForConsole->findOne('platforms', [ - Query::equal('_uid', [$platformId]), + Query::equal('$id', [$platformId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -1488,7 +1488,7 @@ App::get('/v1/projects/:projectId/domains/:domainId') } $domain = $dbForConsole->findOne('domains', [ - Query::equal('_uid', [$domainId]), + Query::equal('$id', [$domainId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -1522,7 +1522,7 @@ App::patch('/v1/projects/:projectId/domains/:domainId/verification') } $domain = $dbForConsole->findOne('domains', [ - Query::equal('_uid', [$domainId]), + Query::equal('$id', [$domainId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -1582,7 +1582,7 @@ App::delete('/v1/projects/:projectId/domains/:domainId') } $domain = $dbForConsole->findOne('domains', [ - Query::equal('_uid', [$domainId]), + Query::equal('$id', [$domainId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); diff --git a/composer.lock b/composer.lock index d53a85ff5a..199ee7f42b 100644 --- a/composer.lock +++ b/composer.lock @@ -2113,12 +2113,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "959bce0d87dc47e41c970964c68bb756dacc33fc" + "reference": "46de56c58555c5740ad79bef0467c7451a7a5bc7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/959bce0d87dc47e41c970964c68bb756dacc33fc", - "reference": "959bce0d87dc47e41c970964c68bb756dacc33fc", + "url": "https://api.github.com/repos/utopia-php/database/zipball/46de56c58555c5740ad79bef0467c7451a7a5bc7", + "reference": "46de56c58555c5740ad79bef0467c7451a7a5bc7", "shasum": "" }, "require": { @@ -2163,7 +2163,7 @@ "issues": "https://github.com/utopia-php/database/issues", "source": "https://github.com/utopia-php/database/tree/appwrite-validators" }, - "time": "2023-05-02T16:55:47+00:00" + "time": "2023-05-03T09:50:09+00:00" }, { "name": "utopia-php/domains", diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 2b66277952..03722f2fd6 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -119,11 +119,11 @@ class FunctionsCustomServerTest extends Scope 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'queries' => [ 'limit(0)' ] + 'queries' => [ 'limit(1)' ] ]); $this->assertEquals($response['headers']['status-code'], 200); - $this->assertCount(0, $response['body']['functions']); + $this->assertCount(1, $response['body']['functions']); $response = $this->client->call(Client::METHOD_GET, '/functions', array_merge([ 'content-type' => 'application/json', @@ -675,11 +675,11 @@ class FunctionsCustomServerTest extends Scope 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'queries' => [ 'limit(0)' ] + 'queries' => [ 'limit(1)' ] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(0, $response['body']['executions']); + $this->assertCount(1, $response['body']['executions']); $response = $this->client->call(Client::METHOD_GET, '/functions/' . $data['functionId'] . '/executions', array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index baef838979..3a9b181921 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -314,10 +314,10 @@ trait StorageBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'queries' => [ 'limit(0)' ] + 'queries' => [ 'limit(1)' ] ]); $this->assertEquals(200, $files['headers']['status-code']); - $this->assertEquals(0, count($files['body']['files'])); + $this->assertEquals(1, count($files['body']['files'])); $files = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $data['bucketId'] . '/files', array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Teams/TeamsBaseClient.php b/tests/e2e/Services/Teams/TeamsBaseClient.php index 271e80a03f..0de99cc357 100644 --- a/tests/e2e/Services/Teams/TeamsBaseClient.php +++ b/tests/e2e/Services/Teams/TeamsBaseClient.php @@ -39,11 +39,11 @@ trait TeamsBaseClient 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'queries' => [ 'limit(0)' ] + 'queries' => [ 'limit(1)' ] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(0, $response['body']['memberships']); + $this->assertCount(1, $response['body']['memberships']); $response = $this->client->call(Client::METHOD_GET, '/teams/' . $teamUid . '/memberships', array_merge([ 'content-type' => 'application/json',