{"size": 728, "ext": "js", "max_stars_repo_path": "src/reducers/admin/adminRegister.js", "max_stars_repo_name": "Joblyn/ronzlsdesk", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/reducers/admin/adminRegister.js", "max_issues_repo_name": "Joblyn/ronzlsdesk", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/reducers/admin/adminRegister.js", "max_forks_repo_name": "Joblyn/ronzlsdesk", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.12, "max_line_length": 67, "alphanum_fraction": 0.6510989011}
import * as ActionTypes from '../../actions/Types';
import { register } from '../initialState';

const adminRegisterReducer = (state = register, action) => {
  switch (action.type) {
    case ActionTypes.ADMIN_REGISTER:
      return { ...state, isLoading: true };
    case ActionTypes.ADMIN_REGISTER_SUCCESS:
      return {
        ...state,
        result: action.payload,
        isLoading: false,
        isSuccessful: true,
      };
    case ActionTypes.ADMIN_REGISTER_FAIL:
      return { ...state, error: action.payload, isLoading: false };
    case ActionTypes.ADMIN_REGISTER_CLEANUP:
      return { ...state, error: null, isLoading: false };
    default:
      return state;
  }
};

export default adminRegisterReducer;
