import { getMandateList } from "../../../services/TaskManage";

export default {
  namespace: 'mandate',
  state: {
    mandateList: [],
  },
  effects: {
    *fetchMandateList({ payload }, { call, put }) {
      const response = yield call(getMandateList, payload);
      if (response) {
        yield put({
          type: 'mandateListHandler',
          payload: response.data.list,
        });
      }
    },
  },

  reducers:{
    mandateListHandler(state, { payload }) {
      return {
        ...state,
        mandateList: payload,
      };
    },
  }
};