mirror of
https://github.com/formbricks/formbricks.git
synced 2026-03-07 01:02:21 -06:00
fix: survey validation bug and verbose logging (#951)
This commit is contained in:
committed by
GitHub
parent
0c6acc0d41
commit
940332ced9
@@ -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;
|
||||
|
||||
@@ -18,7 +18,6 @@ const validationRules = {
|
||||
return question.label.trim() !== "";
|
||||
},
|
||||
defaultValidation: (question: TSurveyQuestion) => {
|
||||
console.log(question);
|
||||
return (
|
||||
question.headline.trim() !== "" &&
|
||||
question.buttonLabel?.trim() !== "" &&
|
||||
|
||||
Reference in New Issue
Block a user