fix: remove comments and console.log

This commit is contained in:
moritzrengert
2023-05-30 09:51:59 +02:00
parent 726b734b1a
commit 9631776552
2 changed files with 2 additions and 6 deletions

View File

@@ -140,11 +140,9 @@ export default function LinkSurvey({ survey }: LinkSurveyProps) {
const submitResponse = async (data: { [x: string]: any }) => {
setLoadingElement(true);
// const questionIdx = survey.questions.findIndex((e) => e.id === currentQuestion?.id);
const nextQuestionId = getNextQuestionId(data);
console.log(nextQuestionId);
const finished = nextQuestionId === "end"; //|| questionIdx === survey.questions.length - 1;
const finished = nextQuestionId === "end";
// build response
const responseRequest = {
surveyId: survey.id,

View File

@@ -164,10 +164,9 @@ export default function SurveyView({ config, survey, close, errorHandler }: Surv
const submitResponse = async (data: { [x: string]: any }) => {
setLoadingElement(true);
// const questionIdx = survey.questions.findIndex((e) => e.id === activeQuestionId);
const nextQuestionId = getNextQuestion(data);
const finished = nextQuestionId === "end"; // || questionIdx === survey.questions.length - 1;
const finished = nextQuestionId === "end";
// build response
const responseRequest = {
surveyId: survey.id,
@@ -193,7 +192,6 @@ export default function SurveyView({ config, survey, close, errorHandler }: Surv
setLoadingElement(false);
if (!finished && nextQuestionId !== "end") {
// setActiveQuestionId(survey.questions[questionIdx + 1].id);
setActiveQuestionId(nextQuestionId);
} else {
setProgress(100);