User options now sent from API correctly.

This commit is contained in:
Matthew Ross 2015-05-27 17:59:30 -04:00
parent 4aa39e6056
commit 5a0df02287
3 changed files with 7 additions and 6 deletions

View File

@ -380,7 +380,7 @@ function createInitialUser() {
$options->showAnimations = true;
$options->showAssignee = true;
$admin->ownOptions = $options;
$admin->ownOptions[] = $options;
R::store($admin);
}

View File

@ -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,

View File

@ -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();