diff --git a/frontend/src/hooks/api/getters/useConstraintsValidation/useConstraintsValidation.ts b/frontend/src/hooks/api/getters/useConstraintsValidation/useConstraintsValidation.ts index 944404d4e3..c3e759119d 100644 --- a/frontend/src/hooks/api/getters/useConstraintsValidation/useConstraintsValidation.ts +++ b/frontend/src/hooks/api/getters/useConstraintsValidation/useConstraintsValidation.ts @@ -16,9 +16,18 @@ export const useConstraintsValidation = ( return; } - const validationRequests = constraints.map(constraint => { - return validateConstraint(constraint); - }); + const validationRequests = constraints + .filter(constraint => { + const hasValues = + Array.isArray(constraint.values) && + constraint.values.length > 0; + const hasValue = Boolean(constraint.value); + + return hasValues || hasValue; + }) + .map(constraint => { + return validateConstraint(constraint); + }); Promise.all(validationRequests) .then(() => setValid(true))