From 403e5773a2884e1af9bca99cb536cf1a3c166615 Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 20 Mar 2025 14:26:11 +0200 Subject: [PATCH] cleanup --- app/controllers/api/account.php | 10 +--------- app/controllers/api/users.php | 5 +---- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index a3dcb7926f..20f64496ac 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -2680,10 +2680,7 @@ App::get('/v1/account/prefs') ->action(function (Response $response, Document $user) { $prefs = $user->getAttribute('prefs', []); - var_dump([ - 'location' => 'account::prefs', - '$prefs' => $prefs, - ]); + $response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES); }); @@ -3080,11 +3077,6 @@ App::patch('/v1/account/prefs') ->inject('queueForEvents') ->action(function (array $prefs, ?\DateTime $requestTimestamp, Response $response, Document $user, Database $dbForProject, Event $queueForEvents) { - var_dump([ - 'userId' => $user->getId(), - 'account:setPrefs' => $prefs, - ]); - $user->setAttribute('prefs', $prefs); $user = $dbForProject->withRequestTimestamp($requestTimestamp, fn () => $dbForProject->updateDocument('users', $user->getId(), $user)); diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 22fffa6df1..4a551b7478 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -1556,10 +1556,7 @@ App::patch('/v1/users/:userId/prefs') if ($user->isEmpty()) { throw new Exception(Exception::USER_NOT_FOUND); } - var_dump([ - 'userId' => $user->getId(), - 'user:setPrefs' => $prefs, - ]); + $user = $dbForProject->updateDocument('users', $user->getId(), $user->setAttribute('prefs', $prefs)); $queueForEvents