| import axios from "axios"; |
|
|
| const api = axios.create({ |
| baseURL: import.meta.env.DEV ? "http://localhost:3000" : "", |
| withCredentials: true, |
| }) |
|
|
|
|
| |
| |
| |
| export const generateInterviewReport = async ({ jobDescription, selfDescription, resumeFile }) => { |
|
|
| const formData = new FormData() |
| formData.append("jobDescription", jobDescription) |
| formData.append("selfDescription", selfDescription) |
| formData.append("resume", resumeFile) |
|
|
| const response = await api.post("/api/interview/", formData, { |
| headers: { |
| "Content-Type": "multipart/form-data" |
| } |
| }) |
|
|
| return response.data |
|
|
| } |
|
|
|
|
| |
| |
| |
| export const getInterviewReportById = async (interviewId) => { |
| const response = await api.get(`/api/interview/report/${interviewId}`) |
|
|
| return response.data |
| } |
|
|
|
|
| |
| |
| |
| export const getAllInterviewReports = async () => { |
| const response = await api.get("/api/interview/") |
|
|
| return response.data |
| } |
|
|
|
|
| |
| |
| |
| export const generateResumePdf = async ({ interviewReportId, candidateAnswers = [] }) => { |
| const response = await api.post(`/api/interview/resume/pdf/${interviewReportId}`, |
| { candidateAnswers }, |
| { responseType: "blob" } |
| ) |
| return response.data |
| } |
|
|
| |
| |
| |
| export const evaluateAnswerAPI = async ({ question, answer }) => { |
| const response = await api.post("/api/interview/evaluate", { question, answer }) |
| return response.data |
| } |