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

@@ -9,6 +9,7 @@ import { useState } from "react";
import { deleteHeliport, upsertHeliport } from "../action";
import { Button } from "../../../../_components/ui/Button";
import { redirect } from "next/navigation";
import toast from "react-hot-toast";
export const HeliportForm = ({ heliport }: { heliport?: Heliport }) => {
const form = useForm({
@@ -24,6 +25,7 @@ export const HeliportForm = ({ heliport }: { heliport?: Heliport }) => {
setLoading(true);
await upsertHeliport(values, heliport?.id);
setLoading(false);
toast.success("Daten gespeichert");
if (!heliport) redirect(`/admin/Heliport`);
})}
className="flex flex-wrap gap-3"