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);
|
titreExistants.push(titre);
|
||||||
|
|
||||||
// -------------------------------
|
|
||||||
// 📌 CRÉATION DE L'ARTICLE
|
// CRÉATION DE L'ARTICLE
|
||||||
// -------------------------------
|
|
||||||
const nouvelArticle = {
|
const nouvelArticle = {
|
||||||
id: Date.now(),
|
id: Date.now(),
|
||||||
titre: titleField.value.trim(),
|
titre: titleField.value.trim(),
|
||||||
contenu: contenu,
|
contenu: contenu,
|
||||||
categorie: categorie,
|
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()
|
date: new Date().toISOString()
|
||||||
};
|
};
|
||||||
|
|
||||||
// --------------------------------
|
|
||||||
// 📌 SAUVEGARDE DANS LOCALSTORAGE
|
// SAUVEGARDE DANS LOCALSTORAGE
|
||||||
// --------------------------------
|
|
||||||
let articles = JSON.parse(localStorage.getItem("articles")) || [];
|
let articles = JSON.parse(localStorage.getItem("articles")) || [];
|
||||||
articles.push(nouvelArticle);
|
articles.push(nouvelArticle);
|
||||||
localStorage.setItem("articles", JSON.stringify(articles));
|
localStorage.setItem("articles", JSON.stringify(articles));
|
||||||
|
|||||||
Reference in New Issue
Block a user