fix: survey validation bug and verbose logging (#951)

This commit is contained in:
Shubham Palriwala
2023-10-05 13:21:20 +05:30
committed by GitHub
parent 0c6acc0d41
commit 940332ced9
2 changed files with 2 additions and 2 deletions

View File

@@ -98,7 +98,6 @@ export default function SurveyMenuBar({
};
const validateSurvey = (survey) => {
const existingLogicConditions = new Set();
const existingQuestionIds = new Set();
if (survey.questions.length === 0) {
@@ -123,6 +122,8 @@ export default function SurveyMenuBar({
}
for (const question of survey.questions) {
const existingLogicConditions = new Set();
if (existingQuestionIds.has(question.id)) {
toast.error("There are 2 identical question IDs. Please update one.");
return false;

View File

@@ -18,7 +18,6 @@ const validationRules = {
return question.label.trim() !== "";
},
defaultValidation: (question: TSurveyQuestion) => {
console.log(question);
return (
question.headline.trim() !== "" &&
question.buttonLabel?.trim() !== "" &&