Edit and actions updates

This commit is contained in:
Darren Clarke 2024-04-25 12:31:03 +02:00
parent 0997e449bb
commit f87bcc43a5
30 changed files with 759 additions and 139 deletions

View file

@ -1,6 +1,6 @@
"use client";
import { FC } from "react";
import { FC, useEffect } from "react";
import { Grid } from "@mui/material";
import { useRouter } from "next/navigation";
import { Button, Dialog } from "ui";
@ -9,6 +9,7 @@ interface CreateProps {
title: string;
entity: string;
formAction: any;
formState: any;
children: any;
}
@ -16,10 +17,17 @@ export const Create: FC<CreateProps> = ({
title,
entity,
formAction,
formState,
children,
}) => {
const router = useRouter();
useEffect(() => {
if (formState.success) {
router.back();
}
}, [formState.success, router]);
return (
<Dialog
open