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 { deleteStation, upsertStation } from "../action";
import { Button } from "../../../../_components/ui/Button";
import { redirect } from "next/navigation";
import toast from "react-hot-toast";
export const StationForm = ({ station }: { station?: Station }) => {
const form = useForm({
@@ -24,6 +25,7 @@ export const StationForm = ({ station }: { station?: Station }) => {
setLoading(true);
await upsertStation(values, station?.id);
setLoading(false);
toast.success("Daten gespeichert");
if (!station) redirect(`/admin/station`);
})}
className="grid grid-cols-6 gap-3"