const API = 'https://rhrhrhtot.climateinvest.bj/api'; async function saveDB() { // Les sauvegardes se font route par route (voir saveEmploye, saveMission...) } async function loadDB() { const [employes, missions, contrats, bulletins] = await Promise.all([ fetch(`${API}/employes`).then(r => r.json()), fetch(`${API}/missions`).then(r => r.json()), fetch(`${API}/contrats`).then(r => r.json()), fetch(`${API}/bulletins`).then(r => r.json()), ]); DB.employes = employes; DB.missions = missions; DB.contrats = contrats; DB.bulletins = bulletins; renderEmployes(); renderMissions(); renderBulletins(); renderContratsIndex(); refreshDashboard(); } // Exemple : sauvegarder un employé via l'API async function saveEmployeAPI(emp) { await fetch(`${API}/employes`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(emp) }); }