From 8aea9dc1c1adece2dfacedf82f6257a51bd68028 Mon Sep 17 00:00:00 2001 From: Cheng Jiyuqing Date: Wed, 9 Nov 2022 15:55:58 +0800 Subject: [PATCH] bug fix --- frontend/src/components/SignupPage.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/SignupPage.js b/frontend/src/components/SignupPage.js index 1aff845b..afae8eef 100644 --- a/frontend/src/components/SignupPage.js +++ b/frontend/src/components/SignupPage.js @@ -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"); }