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