correction erreur
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user