| 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) => { |
| const formData = new FormData(); |
| formData.append('file', file); |
| const response = await api.post('/upload-csv', formData); |
| return response.data; |
| }; |
|
|
| export const runEvaluation = async (jd, candidates) => { |
| const response = await api.post('/evaluate', { jd, candidates }); |
| return response.data; |
| }; |
|
|
| export const getCandidateDetails = async (id) => { |
| const response = await api.get(`/candidate/${id}`); |
| return response.data; |
| }; |
|
|
| export default api; |
|
|