Skip to content

Commit 8520762

Browse files
samuelim01LimZiJia
andauthored
Fix question page error (#100)
* Fix question page error It was using the old error system and was missing a toast for messagingService to serve error messages to user * Fix linting --------- Co-authored-by: LimZiJia <[email protected]>
1 parent fdd794d commit 8520762

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export class QuestionDialogComponent implements OnInit {
130130
this.questionUpdate.emit(response.data);
131131
},
132132
error: (error: HttpErrorResponse) => {
133-
this.errorReceive.emit(error.error.message);
133+
this.errorReceive.emit(error.message);
134134
},
135135
complete: () => {
136136
this.question = {} as Question;
@@ -145,7 +145,7 @@ export class QuestionDialogComponent implements OnInit {
145145
this.questionAdd.emit(response.data);
146146
},
147147
error: (error: HttpErrorResponse) => {
148-
this.errorReceive.emit('Failed to add new question. ' + error.error.message);
148+
this.errorReceive.emit('Failed to add new question. ' + error.message);
149149
},
150150
complete: () => {
151151
this.question = {} as Question;
@@ -182,7 +182,7 @@ export class QuestionDialogComponent implements OnInit {
182182
},
183183
error: (error: HttpErrorResponse) => {
184184
this.topics = [];
185-
this.errorReceive.emit('Failed to load topics. ' + error.error.message);
185+
this.errorReceive.emit('Failed to load topics. ' + error.message);
186186
},
187187
});
188188
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,4 @@ <h3>{{ clickedOnQuestion?.title }}</h3>
128128
</div>
129129
</p-sidebar>
130130
</div>
131+
<p-toast position="bottom-right" [breakpoints]="{ '920px': { width: '90%' } }" />

0 commit comments

Comments
 (0)