Skip to content

Commit 0dc6dbe

Browse files
authored
Refactor signup error handling logic
Removed redundant signup error handling and response logic.
1 parent 57443bd commit 0dc6dbe

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

src/pages/Signup/Signup.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@ const SignUp: React.FC = () => {
4747
if (response.data.message === 'User created successfully') {
4848
navigate("/login");
4949
}
50-
} catch {
51-
setMessage("Something went wrong. Please try again.");
52-
const response = await axios.post(`${backendUrl}/api/auth/signup`, formData);
53-
setMessage(response.data.message);
54-
55-
if (response.data.message === "User created successfully") {
56-
navigate("/login");
57-
}
5850
} catch (error: any) {
5951
setMessage(error.response?.data?.message || "Something went wrong. Please try again.");
6052
} finally {
@@ -257,4 +249,4 @@ const SignUp: React.FC = () => {
257249
);
258250
};
259251

260-
export default SignUp;
252+
export default SignUp;

0 commit comments

Comments
 (0)