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

/**
 *展馆预约-列表
 */

export const B1_APIgetList = (data: any): any => {
  return async (dispatch: AppDispatch) => {
    const res = await http.post("cms/rule/pageList", data);
    if (res.code === 0) {
      const obj = {
        list: res.data.records,
        total: res.data.total,
      };

      dispatch({ type: "B1/getList", payload: obj });
    }
  };
};

/**
 * 展馆预约-详情
 */
export const B1_APIgetInfo = (id: number) => {
  return http.get(`cms/rule/detail/${id}`);
};

/**
 * 展馆预约-删除
 */
export const B1_APIdel = (id: number) => {
  return http.get(`cms/rule/removes/${id}`);
};
