import { routerRedux } from 'dva/router';
import * as badCodeImportService from '../../services/QC/badCodeImport';

export default {

  namespace: 'QCBadCodeImport',
  state: {
  },

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

    },
  },

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

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

};
