dailySalary.js 2.4 KB
import * as types from '../constants/ActionTypes';

const initialState = {
  dailyShareList :{},
  getDailyWage   :{},
  getDailyStatic :{},
  getDailyPayment:{},
  getAttendance  :{},
  is_import      :'init',
  errorMeg       :'',
  getDailyRecruit:{},
  getPositionDet :{},
  getRecruiter   :{},
  add_failed     :'init',
  getCustomService:{},
  reloadPositionDetailStatus:true,
  sailyInvitees  :[]
};

export default function environment(state = initialState,action) {
    switch(action.type) {
      case types.DAILY_SHARE_LIST:
          return Object.assign({}, state, {
              dailyShareList: action.dailyShareList
          });
      case types.GET_DAILY_WAGE:
          return Object.assign({}, state, {
              getDailyWage: action.getDailyWage
          });
      case types.LOAD_DAILY_INVITEES:
          return Object.assign({}, state, {
              sailyInvitees: action.sailyInvitees
          });
      case types.GET_DAILY_STATIC:
          return Object.assign({}, state, {
              getDailyStatic: action.getDailyStatic
          });
      case types.GET_DAILY_PAYMENT:
          return Object.assign({}, state, {
              getDailyPayment: action.getDailyPayment
          });
      case types.GET_ATTENDANCE:
          return Object.assign({}, state, {
              getAttendance: action.getAttendance
          });
      case types.IMPORT_SALARY:
          return Object.assign({}, state, {
              is_import: action.is_import,
              errorMeg : action.errorMeg
          });
      case types.GET_DAILY_RECRUIT:
          return Object.assign({}, state, {
              getDailyRecruit: action.getDailyRecruit
          });
      case types.GET_POSITION_DET:
          return Object.assign({}, state, {
              getPositionDet: action.getPositionDet
          });
      case types.GET_RECRUITER:
          return Object.assign({}, state, {
              getRecruiter: action.getRecruiter
          });
      case types.ADD_DAILY_POSITION:
          return Object.assign({}, state, {
              add_failed: action.add_failed
          });
      case types.GET_CUSTOM_SERVICE:
          return Object.assign({}, state, {
              getCustomService: action.getCustomService
          });
      case types.RELOAD_DAILYPOSI_DET:
          return Object.assign({}, state, {
              reloadPositionDetailStatus: action.reloadPositionDetailStatus
          });
        default:
            return state;
    }
}