import { routerRedux } from 'dva/router';
import * as inStockImportService from '../../services/WH/InStockImport';

export default {

  namespace: 'WHInStockImport',
  state: {
  },

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

    },
  },

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

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

};
