toast für admin-formulare
This commit is contained in:
@@ -10,6 +10,7 @@ import { deleteKeyword, upsertKeyword } from "../action";
|
||||
import { Button } from "../../../../_components/ui/Button";
|
||||
import { redirect } from "next/navigation";
|
||||
import { ListInput } from "_components/ui/List";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
export const KeywordForm = ({ keyword }: { keyword?: Keyword }) => {
|
||||
const form = useForm({
|
||||
@@ -25,6 +26,7 @@ export const KeywordForm = ({ keyword }: { keyword?: Keyword }) => {
|
||||
setLoading(true);
|
||||
await upsertKeyword(values, keyword?.id);
|
||||
setLoading(false);
|
||||
toast.success("Daten gespeichert");
|
||||
if (!keyword) redirect(`/admin/keyword`);
|
||||
})}
|
||||
className="grid grid-cols-6 gap-3"
|
||||
|
||||
Reference in New Issue
Block a user