Skip to content

Commit

Permalink
fix: register page finished
Browse files Browse the repository at this point in the history
  • Loading branch information
Celesca committed Nov 20, 2024
1 parent c809f61 commit 3f1f3ef
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion frontend/src/Register.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,24 @@ const Register = () => {
bio: formData.bio,
});
setMessage("User registered successfully!");
console.log(response.data);

if (response.data) {

console.log(response.data)
setMessage("User registered successfully!");
setFormData({
userName: "",
email: "",
password: "",
confirmPassword: "",
workingStyle: "",
bio: "",
});

localStorage.setItem('userID', JSON.stringify(response.data.UserID));
window.location.href = '/Eventdetail';

}
} catch (error) {
setMessage(error.response?.data || "Error registering user");
}
Expand Down

0 comments on commit 3f1f3ef

Please sign in to comment.