import http from "@/utils/http";
import { AppDispatch } from "..";
/**
 * 获取 兑换记录 列表
 */
export const A5_APIgetList = (data: any) => {
  return async (dispatch: AppDispatch) => {
    const res = await http.post("cms/redeem/pageList", data);
    if (res.code === 0) {
      const obj = {
        list: res.data.records,
        total: res.data.total,
      };
      dispatch({ type: "A5/getList", payload: obj });
    }
  };
};

/**
 * 获取 兑换记录 列表(导出)
 */
export const A5_APIgetListDerive = (data: any) => {
  return http.post("cms/redeem/pageList", data);
};

/**
 * 是否寄送
 */
export const A5_APIgetInfo = (id: number, isSend: 0 | 1) => {
  return http.get(`cms/redeem/update/${id}/${isSend}`);
};

