correction erreur

This commit is contained in:
ben
2025-12-11 11:11:57 +01:00
parent 2125bfb126
commit 9e80b99abe

View File

@@ -63,24 +63,24 @@ form.addEventListener('submit', function(e) {
}
}
// Simuler enregistrement (ancienne logique)
// Simuler enregistrement
titreExistants.push(titre);
// -------------------------------
// 📌 CRÉATION DE L'ARTICLE
// -------------------------------
// CRÉATION DE L'ARTICLE
const nouvelArticle = {
id: Date.now(),
titre: titleField.value.trim(),
contenu: contenu,
categorie: categorie,
published: published, // valeur TRUE/FALSE pour afficher le badge Facebook
published: published, // valeur TRUE/FALSE pour afficher le badge Facebook
date: new Date().toISOString()
};
// --------------------------------
// 📌 SAUVEGARDE DANS LOCALSTORAGE
// --------------------------------
// SAUVEGARDE DANS LOCALSTORAGE
let articles = JSON.parse(localStorage.getItem("articles")) || [];
articles.push(nouvelArticle);
localStorage.setItem("articles", JSON.stringify(articles));