import http from "@/utils/http";
import { AppDispatch } from "..";
/**
 * 获取 视频 / 海报 列表
 */
export const A4_APIgetList = (data: any) => {
  return async (dispatch: AppDispatch) => {
    const res = await http.post("cms/exhibition/pageList", data);
    if (res.code === 0) {
      const obj = {
        list: res.data.records,
        total: res.data.total,
      };
      dispatch({ type: "A4/getList", payload: obj });
    }
  };
};

/**
 * 删除
 */
export const A4_APIdel = (id: number) => {
  return http.get(`cms/exhibition/remove/${id}`);
};

/**
 * 通过id获取详情
 */
export const A4_APIgetInfo = (id: number) => {
  return http.get(`cms/exhibition/detail/${id}`);
};

/**
 * 新增|编辑
 */
export const A4_APIsave = (data: any) => {
  return http.post("cms/exhibition/save", data);
};
