Skip to content

Commit ae4ba44

Browse files
committed
Fix bugs
- Fixed the issue where line break is not being shown in the description table - Fixed the issue where question becomes undefined after an error response is received, causing the form to be not prefilled upon clicking edit button
1 parent 4d25437 commit ae4ba44

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

frontend/src/app/questions/question-dialog.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ export class QuestionDialogComponent implements OnInit {
103103
}
104104

105105
this.dialogClose.emit();
106-
this.question = {} as Question;
107106
}
108107

109108
cancel() {
@@ -134,6 +133,7 @@ export class QuestionDialogComponent implements OnInit {
134133
this.errorReceive.emit(error.error.message);
135134
},
136135
complete: () => {
136+
this.question = {} as Question;
137137
this.successfulRequest.emit('Question has been updated successfully');
138138
},
139139
});
@@ -148,6 +148,7 @@ export class QuestionDialogComponent implements OnInit {
148148
this.errorReceive.emit('Failed to add new question. ' + error.error.message);
149149
},
150150
complete: () => {
151+
this.question = {} as Question;
151152
this.successfulRequest.emit('New Question Added');
152153
},
153154
});

frontend/src/app/questions/questions.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ <h3 class="m-0">Manage Questions</h3>
5959
</td>
6060
<td>{{ question.id }}</td>
6161
<td>{{ question.title }}</td>
62-
<td>{{ question.description }}</td>
62+
<td style="white-space: pre-wrap">{{ question.description }}</td>
6363
<td>{{ question.topics.join(', ') }}</td>
6464
<td>{{ question.difficulty }}</td>
6565
<td>

0 commit comments

Comments
 (0)