import { routerRedux } from 'dva/router';
import * as applyOrderService from '../../services/PO/applyOrder';

export default {

  namespace: 'POApplyOrder',
  state: {
  },

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

    },
  },

  effects: {
    *sendDeliveryDate ({ payload,onComplete }, { call, put }) {
      const ret = yield call(applyOrderService.send, payload);
      if (typeof onComplete === 'function') {
        onComplete(ret)
      }
    },
  },

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

};
