Skip to content

Commit

Permalink
Add toast variants
Browse files Browse the repository at this point in the history
  • Loading branch information
jq1836 committed Sep 27, 2024
1 parent 8fc4224 commit 70bf554
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/components/questions/question-view-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,29 @@ export default function QuestionViewEdit({
toast({
title: "Unknown Error",
description: "An unexpected error has occurred",
variant: "destructive",
});
}
switch (response.status) {
case 200:
toast({
title: "Success",
description: "Question updated successfully!",
variant: "success",
});
break;
case 404:
toast({
title: "Question not found",
description: "Question with specified ID not found",
variant: "destructive",
});
return;
case 409:
toast({
title: "Duplicated title",
description: "The title you entered is already in use",
variant: "destructive",
});
return;
}
Expand Down

0 comments on commit 70bf554

Please sign in to comment.