import { $get, $post, $patch, $put, $del } from "@/plugins/axios";

// work-manage
export const workList = () => {
  return $get("/api/admin/works");
};
export const updateWork = datas => {
  if (datas.id) {
    return $post("/api/admin/works", datas);
  } else {
    return $put(`/api/admin/works/${datas.id}`, datas);
  }
};
export const deleteWork = id => {
  return $del(`/api/admin/works/${id}`);
};
export const activeWork = id => {
  return $patch(`/api/admin/works/${id}`);
};
export const workDetail = id => {
  return $get(`/api/admin/works/${id}`);
};

// subject
export const subjectList = workId => {
  return $get(`/api/marksubjects/getAllSubjectStage/${workId}`);
};

// collect-user
export const collectUserList = () => {
  return $get("/api/admin/users/collect");
};
