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

Loading…
Cancel
Save