{"size": 649, "ext": "js", "max_stars_repo_path": "src/applications/disability-benefits/2346/reducers/form2346Reducer.js", "max_stars_repo_name": "jjwelton187/vets-website", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/applications/disability-benefits/2346/reducers/form2346Reducer.js", "max_issues_repo_name": "jjwelton187/vets-website", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/applications/disability-benefits/2346/reducers/form2346Reducer.js", "max_forks_repo_name": "jjwelton187/vets-website", "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": 16.641025641, "max_line_length": 50, "alphanum_fraction": 0.5485362096}
import {
  FETCH_VETERAN_INFORMATION,
  FETCH_VETERAN_INFORMATION_FAILURE,
} from '../constants';

const initialState = {
  formData: {
    first: '',
    last: '',
    gender: '',
    dateOfBirth: '',
    addressLine1: '',
    city: '',
    state: '',
    country: '',
    zip: '',
    email: '',
  },
};

export default (state = initialState, action) => {
  switch (action.type) {
    case FETCH_VETERAN_INFORMATION:
      return {
        ...state,
        formData: action.data,
      };

    case FETCH_VETERAN_INFORMATION_FAILURE:
      return {
        ...state,
        error: action.error,
      };

    default:
      return state;
  }
};
