fix: update prefs endpoints to not fallback to stdClass

This commit is contained in:
Torsten Dittmann
2023-04-12 18:02:43 +02:00
parent 3009168350
commit 52d7dcf082
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1356,7 +1356,7 @@ App::get('/v1/account/prefs')
->inject('user')
->action(function (Response $response, Document $user) {
$prefs = $user->getAttribute('prefs', new \stdClass());
$prefs = $user->getAttribute('prefs', []);
$response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES);
});
+1 -1
View File
@@ -457,7 +457,7 @@ App::get('/v1/users/:userId/prefs')
throw new Exception(Exception::USER_NOT_FOUND);
}
$prefs = $user->getAttribute('prefs', new \stdClass());
$prefs = $user->getAttribute('prefs', []);
$response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES);
});