text: import { FETCH_ADDRESSES_SUCCESS, FETCH_CLIENTS_SUCCESS, FETCH_CONTACTS_SUCCESS, FETCH_DETAILS_SUCCESS, FETCH_PRICING_SUCCESS, FETCH_PROGRAMS_SUCCESS, FETCH_SELECTIONS_SUCCESS, SET_SELECTED_SUCCESS, UPDATE_STATUS_SUCCESS } from '../actions/clients';
  
  export default function clients(state = {
    entities: [],
    selected: {},
    addresses: [],
    contacts: [],
    details: [],
    pricing: [],
    programs: [],
    selections: {}
  }, action) {
    switch (action.type) {
      case FETCH_CLIENTS_SUCCESS:
        return Object.assign({}, state, {
          isFetching: false,
          entities: action.payload
        });
      case SET_SELECTED_SUCCESS:
        return Object.assign({}, state, {
          isFetching: false,
          selected: {...action.payload}
        });
      case FETCH_ADDRESSES_SUCCESS:
        return Object.assign({}, state, {
          isFetching: false,
          addresses: action.payload
        });
      case FETCH_CONTACTS_SUCCESS:
        return Object.assign({}, state, {
          isFetching: false,
          contacts: action.payload
        });
      case FETCH_DETAILS_SUCCESS:
        return Object.assign({}, state, {
          isFetching: false,
          details: action.payload
        });    
      case FETCH_PRICING_SUCCESS:
        return Object.assign({}, state, {
          isFetching: false,
          pricing: action.payload
        });    
      case FETCH_PROGRAMS_SUCCESS:
        return Object.assign({}, state, {
          isFetching: false,
          programs: action.payload
        });  
      case FETCH_SELECTIONS_SUCCESS:
        return Object.assign({}, state, {
          isFetching: false,
          selections: action.payload
        });
      case UPDATE_STATUS_SUCCESS:
        return Object.assign({}, state, {
          isFetching: false
        });
      default:
        return state;
    }
  }
  