add function creatPost and login wp

This commit is contained in:
sebvtl728
2025-01-31 08:22:48 +01:00
parent 81ac3d831e
commit 841161cb9b
16 changed files with 1177 additions and 355 deletions
+17
View File
@@ -0,0 +1,17 @@
import { deletePost } from "../wordpress";
function DeletePost({ postId, onDelete }) {
const handleDelete = async () => {
if (window.confirm("Es-tu sûr de vouloir supprimer cet article ?")) {
const success = await deletePost(postId);
if (success) {
alert("Article supprimé avec succès !");
onDelete(); // Rafraîchir la liste
}
}
};
return <button onClick={handleDelete}>🗑 Supprimer</button>;
}
export default DeletePost;