diff --git a/app/scripts/controllers/login.coffee b/app/scripts/controllers/login.coffee index c8103eb..9708361 100644 --- a/app/scripts/controllers/login.coffee +++ b/app/scripts/controllers/login.coffee @@ -37,8 +37,9 @@ angular.module('angularCmsApp').controller 'LoginCtrl', ($scope, $rootScope, $co #Change location $rootScope.App.location.path('/dashboard') , - (error)-> - cmsNotify( '.login-message', 'danger', 'Error!', error.message, 2500) + (err)-> + console.error(err) + cmsNotify( '.login-message', 'danger', 'Error!', err.data.message, 2500) ) ### diff --git a/app/scripts/controllers/register.coffee b/app/scripts/controllers/register.coffee index 83b7dd9..327e38b 100644 --- a/app/scripts/controllers/register.coffee +++ b/app/scripts/controllers/register.coffee @@ -32,7 +32,7 @@ angular.module('angularCmsApp').controller 'RegisterCtrl', ($scope, $location, $ #Welcome the user cmsNotify( '.message', 'info', 'Registered!', "You have registered as #{data.user.email}") - + #Set user session session = user: data.user @@ -45,7 +45,7 @@ angular.module('angularCmsApp').controller 'RegisterCtrl', ($scope, $location, $ $location.path('/dashboard') ) , - (error) -> - $log.error(error) - cmsNotify( '.message', 'danger', 'Error!', error.message, 4000) + (err) -> + $log.error(err) + cmsNotify( '.message', 'danger', 'Error!', err.data.message, 4000) ) diff --git a/app/scripts/controllers/users.coffee b/app/scripts/controllers/users.coffee index df2984b..a8a9f59 100644 --- a/app/scripts/controllers/users.coffee +++ b/app/scripts/controllers/users.coffee @@ -11,8 +11,8 @@ angular.module('angularCmsApp').controller('UsersCtrl', ($scope, DataService) -> email: null password: null role: 'member' - created: new Date() - modified: new Date() + created_at: new Date() + updated_at: new Date() metadata: avatar: '' name: null @@ -44,7 +44,6 @@ angular.module('angularCmsApp').controller('UsersCtrl', ($scope, DataService) -> #Delete user $scope.deleteUser = (index, user) -> ask = confirm "Delete #{user.email}?" - if ask DataService.destroy('users', user).then((res) -> $scope.users.pop(index) @@ -53,7 +52,6 @@ angular.module('angularCmsApp').controller('UsersCtrl', ($scope, DataService) -> #Add user to database $scope.addUser = (user) -> - user.created_at = new Date() user.updated_at = new Date() DataService.save('users', user).then((data) -> $scope.getUsers() diff --git a/app/views/users.html b/app/views/users.html index efed6e2..c61b92b 100755 --- a/app/views/users.html +++ b/app/views/users.html @@ -14,10 +14,10 @@