Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FE] fix : 리뷰 작성 페이지에서 유효하지 않은 답변 오류 수정 #333

Merged
merged 7 commits into from
Aug 13, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const useMultipleChoice = ({ question, updateAnswerMap }: UseMultipleChoiceProps
// 유효한 선택(=객관식 문항의 최소,최대 개수를 지켰을 경우)인지에 따라 answer 변경
updateAnswerMap({
questionId: question.questionId,
selectedOptionIds: isValidatedChoice(newSelectedOptionList) ? newSelectedOptionList : null,
selectedOptionIds: isValidatedChoice(newSelectedOptionList) ? newSelectedOptionList : [],
text: null,
});
};
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/hooks/review/writingCardForm/useTextAnswer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const useTextAnswer = ({ question, updateAnswerMap }: UseTextAnswerProps) => {
setTextAnswer(value);
}
// 유효한 답변인지 여부에 따라 답변 변경
updateAnswerMap({ questionId: question.questionId, selectedOptionIds: null, text: isValidatedText ? value : null });
updateAnswerMap({ questionId: question.questionId, selectedOptionIds: null, text: isValidatedText ? value : '' });
};

return {
Expand Down