add network util method to submit form

This commit is contained in:
Alex Holliday committed 2024-10-04 12:39:52 +08:00
1 parent 8e87bdccd0
commit f5547a1825
3 files changed
+38 -3

No files matched your search

@@ -1,7 +1,7 @@
import { Box, Button, Stack, Typography } from "@mui/material";
import { useSelector } from "react-redux";
import { useTheme } from "@emotion/react";
import { act, useEffect, useState } from "react";
import { useEffect, useState } from "react";
import { ConfigBox } from "./styled";
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
import { LocalizationProvider } from "@mui/x-date-pickers";
@@ -148,7 +148,7 @@ const CreateMaintenance = () => {
});
};
const handleSubmit = () => {
const handleSubmit = async () => {
const { error } = maintenanceWindowValidation.validate(form, {
abortEarly: false,
});
@@ -192,6 +192,15 @@ const CreateMaintenance = () => {
}
console.log(submit);
try {
networkService.createMaintenanceWindow({
authToken: authToken,
maintenanceWindow: submit,
});
} catch (error) {
console.log(error);
}
};
return (