Skip to content

Commit

Permalink
[oops] forget to add files #14
Browse files Browse the repository at this point in the history
  • Loading branch information
SylTi committed Nov 16, 2014
1 parent 9f60add commit 40023a0
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
32 changes: 32 additions & 0 deletions client/app/admin/adminEditUser/adminEditUser.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use strict';

angular.module('bitCrowdFundsApp')
.controller('AdminedituserCtrl', function ($scope, $http, $routeParams, Auth) {
$scope.errors = {};

$http.get('/api/users/admin/' + $routeParams.userId)
.success(function(data)
{
$scope.user = data;
console.log(data);
}).error(function (data)
{
$scope.message_settings = 'Something wrong happend' + data;
});

$scope.changeSettings = function(form) {
$scope.submitted = true;
$http.put('/api/users/' + $scope.user._id + '/settings', $scope.user)
.success(function (data)
{
$scope.message_settings = 'Profile updated.';
})
.error( function() {
form.password.$setValidity('mongoose', false);
$scope.errors.other = 'Unknown error';
$scope.message_settings = 'Unknown error';
});

};

});
21 changes: 21 additions & 0 deletions client/app/admin/adminEditUser/adminEditUser.controller.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';

describe('Controller: AdminedituserCtrl', function () {

// load the controller's module
beforeEach(module('bitCrowdFundsApp'));

var AdminedituserCtrl, scope;

// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new();
AdminedituserCtrl = $controller('AdminedituserCtrl', {
$scope: scope
});
}));

it('should ...', function () {
expect(1).toEqual(1);
});
});
Empty file.

0 comments on commit 40023a0

Please sign in to comment.