deleteUsers.js 965 B

123456789101112131415161718192021222324252627282930313233343536
  1. import * as actionTypes from '../../../constants/admin';
  2. import initialState from '../../initialState';
  3. export default function changeEmailReducer(state = initialState.deleteUsers, { type, payload }) {
  4. switch (type) {
  5. case actionTypes.DELETE_USERS_REQUEST: {
  6. return {
  7. ...state,
  8. isFetching: false,
  9. payload
  10. }
  11. }
  12. case actionTypes.DELETE_USERS_REQUEST_SUCCESS: {
  13. // const { user:{email} } = payload;
  14. // console.log(email)
  15. return {
  16. ...state,
  17. isFetching: true,
  18. data:payload
  19. }
  20. }
  21. case actionTypes.DELETE_USERS_REQUEST_FAILURE: {
  22. const { error } = payload;
  23. return {
  24. ...state,
  25. isFetching: false,
  26. error
  27. }
  28. }
  29. default: {
  30. return state;
  31. }
  32. }
  33. }