Skip to content

Commit

Permalink
Fix question page error (#100)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
samuelim01 and LimZiJia authored Nov 13, 2024
1 parent fdd794d commit 8520762
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/src/app/questions/question-dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class QuestionDialogComponent implements OnInit {
this.questionUpdate.emit(response.data);
},
error: (error: HttpErrorResponse) => {
this.errorReceive.emit(error.error.message);
this.errorReceive.emit(error.message);
},
complete: () => {
this.question = {} as Question;
Expand All @@ -145,7 +145,7 @@ export class QuestionDialogComponent implements OnInit {
this.questionAdd.emit(response.data);
},
error: (error: HttpErrorResponse) => {
this.errorReceive.emit('Failed to add new question. ' + error.error.message);
this.errorReceive.emit('Failed to add new question. ' + error.message);
},
complete: () => {
this.question = {} as Question;
Expand Down Expand Up @@ -182,7 +182,7 @@ export class QuestionDialogComponent implements OnInit {
},
error: (error: HttpErrorResponse) => {
this.topics = [];
this.errorReceive.emit('Failed to load topics. ' + error.error.message);
this.errorReceive.emit('Failed to load topics. ' + error.message);
},
});
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/questions/questions.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,4 @@ <h3>{{ clickedOnQuestion?.title }}</h3>
</div>
</p-sidebar>
</div>
<p-toast position="bottom-right" [breakpoints]="{ '920px': { width: '90%' } }" />

0 comments on commit 8520762

Please sign in to comment.