File size: 691 Bytes
ab13a8a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import axios from 'axios';

const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000';

const api = axios.create({
  baseURL: API_URL,
});

export const uploadCSV = async (file: File) => {
  const formData = new FormData();
  formData.append('file', file);
  const response = await api.post('/upload-csv', formData);
  return response.data;
};

export const runEvaluation = async (jd: string, candidates: any[]) => {
  const response = await api.post('/evaluate', { jd, candidates });
  return response.data;
};

export const getCandidateDetails = async (id: string) => {
  const response = await api.get(`/candidate/${id}`);
  return response.data;
};

export default api;