User options now sent from API correctly.
This commit is contained in:
parent
4aa39e6056
commit
5a0df02287
@ -380,7 +380,7 @@ function createInitialUser() {
|
||||
$options->showAnimations = true;
|
||||
$options->showAssignee = true;
|
||||
|
||||
$admin->ownOptions = $options;
|
||||
$admin->ownOptions[] = $options;
|
||||
|
||||
R::store($admin);
|
||||
}
|
||||
|
@ -138,10 +138,12 @@ $app->get('/users/current', function() use($app, $jsonResponse) {
|
||||
if (validateToken()) {
|
||||
$user = getUser();
|
||||
if (null != $user) {
|
||||
$options = [];
|
||||
foreach($user->ownOptions as $option) {
|
||||
$options[] = $option;
|
||||
}
|
||||
$userOptions = R::exportAll($user->ownOption);
|
||||
$options = [
|
||||
'tasksOrder' => $userOptions[0]['tasks_order'],
|
||||
'showAssignee' => $userOptions[0]['show_assignee'],
|
||||
'showAnimations' => $userOptions[0]['show_animations']
|
||||
];
|
||||
$jsonResponse->data = [
|
||||
'userId' => $user->id,
|
||||
'username' => $user->username,
|
||||
|
@ -22,7 +22,6 @@ function ($scope, UserService, AlertService) {
|
||||
.success(function(data) {
|
||||
$scope.currentUser = data.data;
|
||||
$scope.loadingCurrentUser = false;
|
||||
console.log($scope.currentUser.options[0]);
|
||||
});
|
||||
};
|
||||
$scope.loadCurrentUser();
|
||||
|
Reference in New Issue
Block a user