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

@@ -6,6 +6,7 @@ import { PenaltyOptionalDefaults, PenaltyOptionalDefaultsSchema } from "@repo/db
import { Button } from "_components/ui/Button";
import { Switch } from "_components/ui/Switch";
import { useForm } from "react-hook-form";
import toast from "react-hot-toast";
export const ReasonForm = ({
penalty,
@@ -27,6 +28,7 @@ export const ReasonForm = ({
onSubmit={form.handleSubmit(async (penalty) => {
if (!penalty.id) return;
const newPenalty = await editPenalty(penalty.id, penalty);
toast.success("Daten gespeichert");
form.reset(newPenalty);
})}
>