const SET_PHOTOS = 'SET_PHOTOS'

const initialState = {
  photos: [],
  photosDetail: []
}

const photos = (state = initialState, action = {}) => {
  
  switch (action.type) {
    case SET_PHOTOS:
      return {...state, photos: action.payload.ids, photosDetail:action.payload.photoList}
    default:
      return state
  }
}

export default photos

const SET_PHOTOS = 'SET_PHOTOS'

const initialState = {
  photos: [],
  photosDetail: []
}

const photos = (state = initialState, action = {}) => {
  
  switch (action.type) {
    case SET_PHOTOS:
      
      let index = state.photosDetail.filter((el) => {
        return action.payload.photoList.findIndex( (node) => el.node.id == node.node.id)
      });
      return {...state, photos: Array.from(new Set([...state.photos,  ...action.payload.ids])), photosDetail:[...state.photosDetail, ...action.payload.photoList]} 
      
    default:
      return state
  }
}

export default photos

Add conditions to remove duplicates.
Add conditions to remove duplicates.
