feat(frontend): updated to show toasts in create service modal

pull/86/head
Samuel Rowe 3 years ago
parent 8981385bec
commit 3bdf4d3631

@ -15,6 +15,8 @@ import { styled } from "@mui/joy";
import Environment from "./Environment"; import Environment from "./Environment";
import Deploy from "./Deploy"; import Deploy from "./Deploy";
import { classNames } from "../../../utils/styles"; import { classNames } from "../../../utils/styles";
import { toaster } from "../../../utils";
import { reportErrorsAndSubmit } from "../../../utils/forms";
interface IModalServiceProps { interface IModalServiceProps {
onHide: CallbackFunction; onHide: CallbackFunction;
@ -60,6 +62,10 @@ const ModalServiceCreate = (props: IModalServiceProps) => {
onAddEndpoint(result); onAddEndpoint(result);
formik.resetForm(); formik.resetForm();
onHide(); onHide();
toaster(
`Created "${values.serviceName}" service successfully`,
"success"
);
}, },
[onAddEndpoint, onHide] [onAddEndpoint, onHide]
); );
@ -137,7 +143,7 @@ const ModalServiceCreate = (props: IModalServiceProps) => {
<button <button
className="btn-util" className="btn-util"
type="button" type="button"
onClick={formik.submitForm} onClick={reportErrorsAndSubmit(formik)}
> >
Add Add
</button> </button>

Loading…
Cancel
Save