Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengJiyuqing committed Nov 9, 2022
1 parent c7c4f14 commit 8aea9dc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions frontend/src/components/SignupPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,14 @@ function SignupPage() {
.post(URL_USER_SVC, { username, email, password })
.catch((err) => {
if (err.response.status === STATUS_CODE_BAD_REQUEST) {
setDoesUserExist(true);
setErrorDialog("This username already exists. Please login instead");
if (err.response.message === "Email is in the wrong format!") {
setErrorDialog(err.response.message);
} else {
setDoesUserExist(true);
setErrorDialog(
"This username already exists. Please login instead"
);
}
} else {
setErrorDialog("Please try again later");
}
Expand Down

0 comments on commit 8aea9dc

Please sign in to comment.