import { routerRedux } from 'dva/router';
import * as jobFrozenEditService from '../../services/WO/JobFrozenEdit';

export default {

  namespace: 'WoJobFrozen',
  state: {
  },

  subscriptions: {
    setup({ dispatch, history }) {  // eslint-disable-line

    },
  },

  effects: {
    *jobFrozen ({ payload, onComplete }, { call, put}) {
      const ret = yield call(jobFrozenEditService.JobFrozen, payload);
      if (typeof onComplete === 'function') {
        onComplete(ret)
      }
    },
    *jobUnFrozen ({ payload, onComplete }, { call, put}) {
      const ret = yield call(jobFrozenEditService.JobUnFrozen, payload);
      if (typeof onComplete === 'function') {
        onComplete(ret)
      }
    },
    *jobSkipedMes ({ payload, onComplete }, { call, put}) {
      const ret = yield call(jobFrozenEditService.JobSkipedMes, payload);
      if (typeof onComplete === 'function') {
        onComplete(ret)
      }
    }
  },

  reducers: {
    save(state, action) {
      return { ...state, ...action.payload };
    },
  },

};
