import { routerRedux } from 'dva/router';
import * as orderImportService from '../../services/SO/orderImport';

export default {

  namespace: 'SOOrderImport',
  state: {
  },

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

    },
  },

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

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

};
