index.js 644 B

12345678910111213141516171819202122232425
  1. import * as types from "../../../constants";
  2. import initialState from '../../initialState';
  3. export default function changeEmail(state = initialState.changeEmail, {type, payload: login, error }) {
  4. switch (type) {
  5. case types.USERS_CHANGE_REQUEST: {
  6. return state
  7. }
  8. case types.USERS_CHANGE_REQUEST_SUCCESS: {
  9. return {
  10. ...state,
  11. login
  12. }
  13. }
  14. case types.USERS_CHANGE_REQUEST_FAILURE: {
  15. return {
  16. ...state,
  17. error
  18. }
  19. }
  20. default: {
  21. return state
  22. }
  23. }
  24. }