Skip to content

Commit

Permalink
Fix edit question modal bug
Browse files Browse the repository at this point in the history
  • Loading branch information
SelwynAng committed Oct 17, 2024
1 parent 2db6ce6 commit b41139f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/components/questions/question-form-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ const QuestionFormModal: React.FC<QuestionFormModalProps> = ({ ...props }) => {
e.preventDefault();

props.handleSubmit(question);
setQuestion(initialQuestionState);
if (props.initialData) {
setQuestion(props.initialData);
} else {
setQuestion(initialQuestionState);
}
};

const handleExit = () => {
Expand Down

0 comments on commit b41139f

Please sign in to comment.