import { routerRedux } from 'dva/router';
import * as InMaterialSendInspectService from '../../services/WH/InMaterialSendInspect';

export default {

  namespace: 'WHInMaterialSendInspect',
  state: {
  },

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

    },
  },

  effects: {
    *sendInspect ({ payload,onComplete }, { call, put }) {
      const ret = yield call(InMaterialSendInspectService.sendInspection, payload);
      if (typeof onComplete === 'function') {
        onComplete(ret)
      }
    },
  },

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

};
