Skip to content

Commit

Permalink
Merge pull request #177 from CS3219-AY2425S1/fix/bug/edit-question-modal
Browse files Browse the repository at this point in the history
Fix edit question modal bug
  • Loading branch information
jq1836 authored Oct 18, 2024
2 parents d66ba75 + b41139f commit bfdd8ec
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 bfdd8ec

Please sign in to comment.