toast für admin-formulare
This commit is contained in:
@@ -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);
|
||||
})}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user