toast für admin-formulare

This commit is contained in:
PxlLoewe
2025-07-13 01:13:13 -07:00
parent a144b9efcd
commit 90e05dc478
4 changed files with 8 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ import { deleteKeyword, upsertKeyword } from "../action";
import { Button } from "../../../../_components/ui/Button";
import { redirect } from "next/navigation";
import { ListInput } from "_components/ui/List";
import toast from "react-hot-toast";
export const KeywordForm = ({ keyword }: { keyword?: Keyword }) => {
const form = useForm({
@@ -25,6 +26,7 @@ export const KeywordForm = ({ keyword }: { keyword?: Keyword }) => {
setLoading(true);
await upsertKeyword(values, keyword?.id);
setLoading(false);
toast.success("Daten gespeichert");
if (!keyword) redirect(`/admin/keyword`);
})}
className="grid grid-cols-6 gap-3"