fix: update prefs endpoints to not fallback to stdClass
This commit is contained in:
parent
3009168350
commit
52d7dcf082
2 changed files with 2 additions and 2 deletions
|
@ -1356,7 +1356,7 @@ App::get('/v1/account/prefs')
|
||||||
->inject('user')
|
->inject('user')
|
||||||
->action(function (Response $response, Document $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);
|
$response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES);
|
||||||
});
|
});
|
||||||
|
|
|
@ -457,7 +457,7 @@ App::get('/v1/users/:userId/prefs')
|
||||||
throw new Exception(Exception::USER_NOT_FOUND);
|
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);
|
$response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue