Modify role

This commit is contained in:
T'JAMPENS QUENTIN p2406187
2026-01-13 11:51:05 +01:00
parent 6bb4b62e4d
commit 28cc9c13eb
4 changed files with 115 additions and 2 deletions
+21
View File
@@ -0,0 +1,21 @@
export default async function getRoles() {
try {
const res = await fetch(`${import.meta.env.VITE_API_URL}/api/roles`, {
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;
}
}