Skip to content

Commit

Permalink
#54 requested changes 1
Browse files Browse the repository at this point in the history
  • Loading branch information
pbgnz committed Feb 9, 2017
1 parent a62db64 commit ae98c82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion client/modules/User/UserReducer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ADD_USER, LOGIN_USER } from './UserActions';
import { ADD_USER, UPDATE_USER, LOGIN_USER } from './UserActions';

// Initial State
const initialState = { data: [], user: null };
Expand All @@ -9,6 +9,10 @@ const UserReducer = (state = initialState, action) => {
return {
data: [action.user, ...state.data],
};
case UPDATE_USER :
return {
data: [action.user, ...state.data],
};
case LOGIN_USER: {
const user = (action.response.statusCode === 200) ? action.response.user : null;

Expand Down
2 changes: 1 addition & 1 deletion server/routes/user.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ router.route('/:cuid').get(ensureAuthenticated, UserController.getUser);
router.route('/').post(UserController.addUser);

// Update User by cuid
router.route('/:cuid').put(UserController.updateUser);
router.route('/:cuid').put(ensureAuthenticated, UserController.updateUser);

// Delete User by cuid
router.route('/:cuid').delete(UserController.deleteUser);
Expand Down

0 comments on commit ae98c82

Please sign in to comment.