{"size": 593, "ext": "js", "max_stars_repo_path": "store/reducers/albumPhotos.js", "max_stars_repo_name": "bsatria/nextjs-socialmedia", "max_stars_repo_stars_event_min_datetime": "2021-06-06T13:43:33.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-06T13:43:33.000Z", "max_issues_repo_path": "store/reducers/albumPhotos.js", "max_issues_repo_name": "bsatria/nextjs-socialmedia", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "store/reducers/albumPhotos.js", "max_forks_repo_name": "bsatria/nextjs-socialmedia", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.65, "max_line_length": 62, "alphanum_fraction": 0.6323777403}
import actionTypes from "../type";

// eslint-disable-next-line import/prefer-default-export
export const albumPhotos = (state = [], action) => {
  switch (action.type) {
    case actionTypes.GET_ALBUM_PHOTOS_LIST:
      return { ...state, loading: false, ...action.payload };
    case actionTypes.GET_ALBUM_PHOTOS_LIST_REQUEST:
      return { ...state, loading: true };
    case actionTypes.GET_ALBUM_PHOTOS_LIST_FAILURE:
      return {
        ...state,
        loading: false,
        errorMessage: action.payload.message
      };
    default:
      return state;
  }
};
