fix: consent question's checkbox should now have some text or default text mandatory

This commit is contained in:
ShubhamPalriwala
2023-08-29 19:42:17 +05:30
parent c10854523d
commit 6dfc75a4ce

View File

@@ -1,6 +1,7 @@
// extend this object in order to add more validation rules
import {
ConsentQuestion,
MultipleChoiceMultiQuestion,
MultipleChoiceSingleQuestion,
Question,
@@ -13,6 +14,9 @@ const validationRules = {
multipleChoiceSingle: (question: MultipleChoiceSingleQuestion) => {
return !question.choices.some((element) => element.label.trim() === "");
},
consent: (question: ConsentQuestion) => {
return question.label.trim() !== "";
},
defaultValidation: (question: Question) => {
return question.headline.trim() !== "";
},