mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-15 16:33:23 +02:00
duplicate controller. This was moved under settings/
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('users').controller('SettingsController', ['$scope', '$http', '$location', 'Users', 'Authentication',
|
||||
function($scope, $http, $location, Users, Authentication) {
|
||||
$scope.user = Authentication.user;
|
||||
|
||||
// If user is not signed in then redirect back home
|
||||
if (!$scope.user) $location.path('/');
|
||||
|
||||
// Update a user profile
|
||||
$scope.updateUserProfile = function(isValid) {
|
||||
if (isValid){
|
||||
$scope.success = $scope.error = null;
|
||||
var user = new Users($scope.user);
|
||||
|
||||
user.$update(function(response) {
|
||||
$scope.success = true;
|
||||
Authentication.user = response;
|
||||
}, function(response) {
|
||||
$scope.error = response.data.message;
|
||||
});
|
||||
} else {
|
||||
$scope.submitted = true;
|
||||
}
|
||||
};
|
||||
}
|
||||
]);
|
||||
Reference in New Issue
Block a user