This commit is contained in:
2026-04-11 23:30:14 +02:00
parent 10ca8c3e8c
commit b73939d381
1574 changed files with 621 additions and 57974 deletions

View File

@@ -5,6 +5,7 @@ import { useRouter } from 'next/navigation';
import { createBlogPost, updateBlogPost } from '@/app/actions/blog';
import { Loader2, ArrowLeft, Save } from 'lucide-react';
import Link from 'next/link';
import { toast } from 'react-hot-toast';
interface Props {
initialData?: {
@@ -38,10 +39,11 @@ export default function BlogForm({ initialData }: Props) {
: await createBlogPost(data);
if (result.success) {
toast.success(initialData ? "Article mis à jour" : "Article publié avec succès");
router.push('/blog');
router.refresh();
} else {
alert(result.error);
toast.error(result.error || "Une erreur est survenue");
}
});
};