move utils files

This commit is contained in:
2025-12-17 14:16:08 +01:00
parent 883b9b6c4b
commit 0aaafed26a
13 changed files with 58 additions and 9 deletions
+23
View File
@@ -0,0 +1,23 @@
export default async function GetEventById(id) {
try {
const res = await fetch(`http://${import.meta.env.VITE_API_URL}/api/events/${id}`, {
method: 'GET',
credentials: 'include',
headers: {
'Accept': 'application/json'
}
});
if (!res.ok) {
throw new Error(`Erreur serveur : ${res.status}`);
}
const data = await res.json();
return data;
} catch (err) {
console.error('Erreur :', err);
return null;
}
}