import { $postParam, $post } from "@/plugins/axios";

export const cardConfigInfos = (id) => {
  return $postParam("/api/admin/basic/card_rule/get_one", { id });
};
export const cardDetail = (cardId) => {
  return $postParam("/api/admin/exam/card/get_one", { cardId });
};

export const saveCard = (datas, config = {}) => {
  if (datas.type === "GENERIC") {
    return $post("/api/admin/exam/card/save_generic", datas, config);
  } else {
    return $post("/api/admin/exam/card/save", datas, config);
  }
};
export const copyCard = (cardId, courseId) => {
  return $postParam("/api/admin/exam/card/copy", { id: cardId, courseId });
};
