import { http } from "@/utils/http";
import type { FileInfo } from "types/file";

/**上传文件 */
export const postUploadFileAPI = (data: { file: Blob }) => {
  return http.request<FileInfo>("post", "/api/file/upload", {
    data,
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};

/**删除文件 */
export const deleteFileAPI = (id: string) => {
  return http.request<null>("delete", `/api/file/delete/${id}`);
};
