import * as woService from '../../services/WO/orderFlowCard';

export default {

  namespace: 'WOOrderFlowCard',
  state: {
  },

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

    },
  },

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

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

};
