import axios from "@/config/axios";
import type { CreateJobType, GetJobsResponse } from "../types/Types";

export const getJobs = async (page: number = 1): Promise<GetJobsResponse> => {
  const { data } = await axios.get(`/jobs?page=${page}`);
  return data;
};

export const createJob = async (params: CreateJobType) => {
  const { data } = await axios.post("/admin/settings/jobs", params);
  return data;
};

export const deleteJob = async (jobId: string) => {
  const { data } = await axios.delete(`/admin/settings/jobs/${jobId}/delete`);
  return data;
};

export const getResumes = async (page: number = 1) => {
  const { data } = await axios.get(`/admin/settings/jobs/resume?page=${page}`);
  return data;
};
