mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-24 19:01:01 -06:00
correct handleSelectMonitors function to align with Search component
This commit is contained in:
@@ -137,7 +137,7 @@ const CreateMaintenance = () => {
|
||||
limit: null,
|
||||
types: ["http", "ping", "pagespeed"],
|
||||
});
|
||||
const monitors = response.data.data.filteredMonitors; //fetching monitor data from fileterdMonitors
|
||||
const monitors = response.data.data.monitors;
|
||||
setMonitors(monitors);
|
||||
|
||||
if (maintenanceWindowId === undefined) {
|
||||
@@ -178,13 +178,10 @@ const CreateMaintenance = () => {
|
||||
setSearch(value);
|
||||
};
|
||||
|
||||
const handleSelectMonitors = (event, selectedMonitors) => {
|
||||
const monitorsArray = Array.isArray(event) ? event : selectedMonitors; // Check if the selected monitors are in event or the selectedMonitors
|
||||
if (!monitorsArray) return;
|
||||
|
||||
setForm({ ...form, monitors: monitorsArray }); // Update form state with the selected monitors
|
||||
const handleSelectMonitors = (monitors) => {
|
||||
setForm({ ...form, monitors });
|
||||
const { error } = maintenanceWindowValidation.validate(
|
||||
{ monitors: monitorsArray },
|
||||
{ monitors },
|
||||
{ abortEarly: false }
|
||||
);
|
||||
setErrors((prev) => {
|
||||
|
||||
Reference in New Issue
Block a user