import axios from "@/config/axios";
import { JobsResponse, ResumeType, UploadResponse } from "../types/Types";

export const getJobs = async (): Promise<JobsResponse> => {
  const { data } = await axios.get("/jobs");
  return data;
};

export const sendResume = async (resume: ResumeType): Promise<void> => {
  const { data } = await axios.post("/jobs/resume", resume);
  return data;
};

export const uploadSingleFile = async (file: File): Promise<UploadResponse> => {
  const formData = new FormData();
  formData.append("resume", file);
  const { data } = await axios.post("/jobs/upload/single", formData);
  return data;
};
