joblist front
This commit is contained in:
parent
08bb8deec5
commit
344fccac45
4 changed files with 48 additions and 8 deletions
|
@ -13,7 +13,7 @@ import {
|
|||
} from '@mui/material';
|
||||
import { Link } from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import type { JobOffer } from '../types';
|
||||
import type { JobOffer, JobSearchResponse } from '../types';
|
||||
|
||||
const API_BASE_URL = 'http://localhost:3000/api/jobs';
|
||||
|
||||
|
@ -26,8 +26,8 @@ const JobList: React.FC = () => {
|
|||
const fetchJobs = async () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const response = await axios.get<JobOffer[]>(API_BASE_URL);
|
||||
setJobs(response.data);
|
||||
const response = await axios.get<JobSearchResponse>(API_BASE_URL);
|
||||
setJobs(response.data.jobs);
|
||||
setError(null);
|
||||
} catch (err) {
|
||||
console.error("Erreur lors de la récupération des offres:", err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue