Show task is assigned to user + fix assign user

This commit is contained in:
T'JAMPENS QUENTIN p2406187
2026-01-12 15:35:22 +01:00
parent 00c02a4c30
commit 6d15582819
5 changed files with 104 additions and 33 deletions
+24
View File
@@ -0,0 +1,24 @@
export default async function isAssigned(taskId) {
try {
const res = await fetch(
`http://${import.meta.env.VITE_API_URL}/api/events/tasks/${taskId}/assigned`,
{
method: 'GET',
credentials: 'include',
headers: {
'Accept': 'application/json',
},
}
);
if (!res.ok) {
throw new Error(`Erreur serveur : ${res.status}`);
}
return await res.json();
} catch (err) {
console.error('Erreur :', err);
return null;
}
}