provident.js 1.6 KB
import * as types from '../constants/ActionTypes';

const initialState = {
    customerProvidentListCount:0,
    customerProvidentList:[],
    payingList: [],
    payingListCount: 0,
    supplementList: [],
    supplementListCount: 0,
    stopList: [],
    stopListCount: 0,
    addList: [],
    addListCount: 0
};

export default function environment(state = initialState, action) {
    switch (action.type) {
      case types.GET_CUSTOMER_PROVIDENT_LIST:
          return Object.assign({}, state, {
              customerProvidentList: action.customerProvidentList,
              customerProvidentListCount: action.customerProvidentListCount
          });
          break;
        case types.GET_PROVIDENT_PAYING_LIST:
            return Object.assign({}, state, {
                payingList: action.payingList,
                payingListCount: action.payingListCount
            });
            break;
        case types.GET_PROVIDENT_SUPPLEMENT_LIST:
            return Object.assign({}, state, {
                supplementList: action.supplementList,
                supplementListCount: action.supplementListCount
            });
            break;
        case types.GET_PROVIDENT_STOP_LIST:
            return Object.assign({}, state, {
                stopList: action.stopList,
                stopListCount: action.stopListCount
            });
            break;
        case types.GET_PROVIDENT_ADD_LIST:
            return Object.assign({}, state, {
                addList: action.addList,
                addListCount: action.addListCount
            });
            break;
        default:
            return state;
    }
}