import http from "@/utils/http";
import { AppDispatch } from "..";

/**
 *宁博展览-列表
 */

export const A5_APIgetList = (data: any): 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: "A5/getList", payload: obj });
    }
  };
};

/**
 * 宁博展览-删除
 */
export const A5_APIdel = (id: number) => {
  return http.get(`cms/exhibition/removes/${id}`);
};

/**
 * 宁博展览-获取详情
 */
export const A5_APIgetInfo = (id: number) => {
  return http.get(`cms/exhibition/detail/${id}`);
};

/**
 * 宁博展览-新增、编辑
 */
export const A5_APIsave = (data: any) => {
  return http.post("cms/exhibition/save", data);
};
