- handle Validation onBlur , special cases for usage numbers required on condition of checkbox checked

- handle generate payload correspondant to BE format
- comment out retain log period,retry max and 3 other usage threshold currently not avalable yet in BE
This commit is contained in:
Shemy Gan committed 2024-11-07 15:26:22 -05:00
1 parent df7813c6aa
commit 9237f46e7c
3 files changed
+168 -119

No files matched your search

+4
View File
@@ -26,6 +26,10 @@ const hasValidationErrors = (form, validation, setErrors) => {
) {
newErrors[err.path[0]] = err.message ?? "Validation error";
}
// Handle conditionally usage number required cases
if (!form.cpu || (form.cpu && form.usage_cpu)) {
delete newErrors["usage_cpu"];
}
});
if (Object.keys(newErrors).length > 0) {
setErrors(newErrors);