Commit c6065999693cb9d228bfa83a6f40ce2123faf9fc

Authored by Caio Almeida
1 parent 7e408942

Upgrading to new login API

Showing 1 changed file with 4 additions and 4 deletions   Show diff stats
www/js/controllers.js
... ... @@ -121,10 +121,10 @@ angular.module('confjuvapp.controllers', [])
121 121 .then(function(resp) {
122 122 $scope.closeModal();
123 123 var popup = $ionicPopup.alert({ title: 'Login', template: 'Login efetuado com sucesso!' });
124   - $scope.profile = resp.data.person;
  124 + $scope.profile = resp.data.user.person;
125 125 $scope.setStateAndCityOfProfile();
126 126 popup.then(function() {
127   - $scope.loginCallback(resp.data.private_token);
  127 + $scope.loginCallback(resp.data.user.private_token);
128 128 });
129 129 }, function(err) {
130 130 $scope.closeModal();
... ... @@ -1391,7 +1391,7 @@ console.log($scope.profile);
1391 1391  
1392 1392 $http.get(ConfJuvAppUtils.pathTo(path))
1393 1393 .then(function(resp) {
1394   - $scope.profile = resp.data.person;
  1394 + $scope.profile = resp.data.user.person;
1395 1395 $scope.loginCallback(ConfJuvAppUtils.getPrivateToken());
1396 1396 $scope.loadMyBadges();
1397 1397 $scope.setStateAndCityOfProfile();
... ... @@ -1500,7 +1500,7 @@ console.log($scope.profile);
1500 1500  
1501 1501 $http.post(ConfJuvAppUtils.pathTo('people/' + $scope.profile.id), jQuery.param(params), config)
1502 1502 .then(function(resp) {
1503   - $scope.profile = resp.data.person;
  1503 + $scope.profile = resp.data.user.person;
1504 1504 $scope.setStateAndCityOfProfile();
1505 1505 var popup = $ionicPopup.alert({ title: 'Perfil', template: 'Perfil atualizado com sucesso' });
1506 1506 popup.then(function() {
... ...