fix: skip future date validation when editing maintenance window
This commit is contained in:
1 parent
45618a2ab0
commit
1a54a24fd5
2 files changed
+29
-26
No files matched your search
@@ -2,6 +2,7 @@ import { useMemo } from "react";
|
||||
import dayjs from "dayjs";
|
||||
import {
|
||||
maintenanceWindowSchema,
|
||||
maintenanceWindowEditSchema,
|
||||
repeatOptions,
|
||||
type MaintenanceWindowFormData,
|
||||
} from "@/Validation/maintenanceWindow";
|
||||
@@ -47,6 +48,6 @@ export const useMaintenanceWindowForm = ({
|
||||
};
|
||||
}
|
||||
|
||||
return { schema: maintenanceWindowSchema, defaults };
|
||||
return { schema: data ? maintenanceWindowEditSchema : maintenanceWindowSchema, defaults };
|
||||
}, [data]);
|
||||
};
|
||||
Reference in new issue
Block a user