1
0
Fork 0
mirror of synced 2024-09-28 23:41:23 +12:00

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

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);
});

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);
});