import { routerRedux } from 'dva/router';
import * as Location from '../../services/WH/WHLocation';

export default {

  namespace: 'WHLocation',
  state: {
  },

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

    },
  },

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

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

};
