diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/HiddenFieldsCard.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/HiddenFieldsCard.tsx index 68697e0ffd..dcb0bc4045 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/HiddenFieldsCard.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/HiddenFieldsCard.tsx @@ -162,7 +162,10 @@ const validateHiddenField = ( return "Question already exists"; } // no key words -- userId & suid & existing question ids - if (["userId", "suid"].includes(field) || existingQuestions.findIndex((q) => q.id === field) !== -1) { + if ( + ["userId", "source", "suid", "end", "start", "welcomeCard", "hidden"].includes(field) || + existingQuestions.findIndex((q) => q.id === field) !== -1 + ) { return "Question not allowed"; } // no spaced words --> should be valid query param on url diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/UpdateQuestionId.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/UpdateQuestionId.tsx index 7d7903ff74..65f873f9e5 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/UpdateQuestionId.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/UpdateQuestionId.tsx @@ -40,10 +40,10 @@ export default function UpdateQuestionId({ updateQuestion(questionIdx, { id: prevValue }); toast.error("ID should not be empty."); return; - } else if (currentValue === "source" || currentValue === "suID" || currentValue === "userId") { + } else if (["userId", "source", "suid", "end", "start", "welcomeCard", "hidden"].includes(currentValue)) { setCurrentValue(prevValue); updateQuestion(questionIdx, { id: prevValue }); - toast.error("ID cannot used reserved words."); + toast.error("Reserved words cannot be used as question ID"); return; } else { setIsInputInvalid(false);