import { routerRedux } from 'dva/router';
import * as applyOrderToOrderService from '../../services/PO/applyOrderToOrder';

export default {

  namespace: 'POApplyOrderToOrder',
  state: {
  },

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

    },
  },

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

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

};
