- set error as null instead of delete it

- customize checkbox to pass in element as label
- adjust checkbox posion to appear align top with string within the element label based on review feedback
- remove the checkbox margin setting instead of comment out
This commit is contained in:
Shemy Gan committed 2024-11-14 11:01:36 -05:00
1 parent 407e5a8711
commit a9aece6123
3 files changed
+37 -29

No files matched your search

+3 -3
View File
@@ -29,13 +29,13 @@ const hasValidationErrors = (form, validation, setErrors) => {
}
// Handle conditionally usage number required cases
if (!form.cpu || (form.cpu && form.usage_cpu)) {
delete newErrors["usage_cpu"];
newErrors["usage_cpu"] = null;
}
if (!form.memory || (form.memory && form.usage_memory)) {
delete newErrors["usage_memory"];
newErrors["usage_memory"] = null;
}
if (!form.disk || (form.disk && form.usage_disk)) {
delete newErrors["usage_disk"];
newErrors["usage_disk"] = null;
}
});
if (Object.keys(newErrors).length > 0) {