export default async function deleteUser(userId) { try { const res = await fetch(`http://${import.meta.env.VITE_API_URL}/api/users/${userId}`, { method: 'DELETE', credentials: 'include', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', }, }); if (!res.ok) { throw new Error(`Erreur serveur : ${res.status}`); } const data = await res.json(); return data; } catch (err) { console.error('Erreur lors de la suppression :', err); return null; } }