From de4289509694cc900dea31c5cd904a513eb56171 Mon Sep 17 00:00:00 2001 From: shimon Date: Tue, 16 Aug 2022 14:27:50 +0300 Subject: [PATCH] fill gaps from merge --- app/controllers/api/account.php | 6 +++--- app/controllers/api/users.php | 1 - tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 949d5f4928..1c0d7f4b05 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -1407,11 +1407,11 @@ App::post('/v1/account/sessions/anonymous') $protocol = $request->getProtocol(); if ('console' === $project->getId()) { - throw new Exception(Exception::USER_ANONYMOUS_CONSOLE_PROHIBITED, 'Failed to create anonymous user.'); + throw new Exception(Exception::USER_ANONYMOUS_CONSOLE_PROHIBITED, 'Failed to create anonymous user'); } if (!$user->isEmpty()) { - throw new Exception(Exception::USER_SESSION_ALREADY_EXISTS, 'Cannot create an anonymous user when logged in.'); + throw new Exception(Exception::USER_SESSION_ALREADY_EXISTS, 'Cannot create an anonymous user when logged in'); } $limit = $project->getAttribute('auths', [])['limit'] ?? 0; @@ -1420,7 +1420,7 @@ App::post('/v1/account/sessions/anonymous') $total = $dbForProject->count('users', max: APP_LIMIT_USERS); if ($total >= $limit) { - throw new Exception(Exception::USER_COUNT_EXCEEDED, 'Project registration is restricted. Contact your administrator for more information.'); + throw new Exception(Exception::USER_COUNT_EXCEEDED); } } diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 10ce8b912c..d1d42512a7 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -734,7 +734,6 @@ App::patch('/v1/users/:userId/prefs') $response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES); $response->dynamic($user, Response::MODEL_USER); - }); App::delete('/v1/users/:userId/sessions/:sessionId') diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php index fd34c8bcb9..594d5c9f76 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php @@ -289,7 +289,7 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); $this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide())); - $this->assertEquals($webhook['data']['a'], 'b'); + $this->assertEquals($webhook['data']['prefs']['a'], 'b'); return $data; }