Skip to content

Commit 6667b7b

Browse files
committed
removed updating user functionality
1 parent cff70f5 commit 6667b7b

File tree

4 files changed

+4
-18
lines changed

4 files changed

+4
-18
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ API endpoints at ```localhost:8000/api/``` :
2929
| POST | /user | username : password | none | Create a User and returns token|
3030
| GET | /users | - - - | none | Returns List of User Objects |
3131
| GET | /user/:id | - - - | none | Returns the user with the given ID |
32-
| PUT | /user/:id | - - - | isAuthorized, isCurrentUser | Updates user with the a given ID |
3332
| DEL | /user/:id | - - - | isAuthorized, isCurrentUser | Deletes a user with the given ID |
3433
| POST | /login | username : password | none | Log In Route : Returns logged in user and token |
3534

server.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ app.get('/', function(req, res){
3535
router.route('/user').post(userController.register);
3636
router.route('/users').get(userController.users);
3737
router.route('/user/:id').get(userController.user);
38-
router.route('/user/:id').put(isAuthorized, isCurrentUser, userController.editUser);
3938
router.route('/user/:id').delete(isAuthorized, isCurrentUser, userController.deleteUser);
4039

4140
router.route('/login').post(authController.authenticate);

server/controllers/userController.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,6 @@ exports.user = function(req , res){
4848
});
4949
};
5050

51-
52-
exports.editUser = function(req , res){
53-
54-
var id = req.params.id;
55-
User.get(id).run().then(function(user){
56-
if (req.body.username) {user.username = req.body.username;}
57-
if (req.body.encyptedPW) {user.password = req.body.password;}
58-
user.save().then(function(result) {
59-
res.status(200).json({ message: 'User Updated !!'});
60-
}).error(function(res){
61-
res.status(404).json({message : 'An Error has Occured'});
62-
});
63-
});
64-
};
65-
66-
6751
exports.deleteUser = function(req , res){
6852

6953
var id = req.params.id;

test/test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ describe('User Tests', function() {
120120

121121
});
122122

123+
describe('Authenticating a User', function (){
124+
125+
});
126+
123127
describe('Deleting a User', function() {
124128

125129
it('should give correct error message and 400 status when no auth token is found', function(done) {

0 commit comments

Comments
 (0)