babillard/ui/js/carousel.js

33 lines
771 B
JavaScript
Raw Permalink Normal View History

// 2025-02 Victor Lacasse-Beaudoin, AGECEM
//
// Carousel d'images à afficher sur https://babillard.agecem.com/ ainsi que
// sur la télévision du Centre-Multi Services de l'AGECEM.
//
// WIP
async function getContenu() {
const url = "/api/v2/contenu/";
try {
const response = await fetch(url);
if (!response.ok) {
//TODO start interval then refresh page to try again
throw new Error(`Response status: ${response.status}`);
}
json = await response.json();
console.log("[i] got contenu");
console.log(json);
//startCarousel(json);
}
catch (error) {
console.error(error.message);
}
}
function run(){
console.log("[i] run");
getContenu();
}
run();