Début du projet
This commit is contained in:
commit
43b1f166d7
28 files changed
+4284
No files matched your search
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Page archives : animaux décédés.
|
||||
*/
|
||||
|
||||
async function chargerArchives()
|
||||
{
|
||||
const animaux = await appelerApi("/api/animaux?archives=oui");
|
||||
|
||||
if (!animaux)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const liste = document.getElementById("listeArchives");
|
||||
const messageVide = document.getElementById("messageVide");
|
||||
|
||||
if (animaux.length === 0)
|
||||
{
|
||||
liste.innerHTML = "";
|
||||
messageVide.hidden = false;
|
||||
return;
|
||||
}
|
||||
|
||||
messageVide.hidden = true;
|
||||
liste.innerHTML = animaux.map(htmlCarteAnimal).join("");
|
||||
}
|
||||
|
||||
async function demarrer()
|
||||
{
|
||||
const utilisateur = await verifierSession();
|
||||
|
||||
if (!utilisateur)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
brancherDeconnexion();
|
||||
await chargerArchives();
|
||||
}
|
||||
|
||||
demarrer();
|
||||