diff --git a/back-end/App.js b/back-end/App.js index 49c04a0..ae405fd 100644 --- a/back-end/App.js +++ b/back-end/App.js @@ -462,7 +462,7 @@ app.get('/chatUser', authenticateToken, (req, res) => { app.get('/profile', authenticateToken, (req, res) => { // Add 'year' to the list of fields to return - User.findById(req.user.id, 'username profile.year profile.bio imagePath') + User.findById(req.user.id, 'username answers.year profile.bio imagePath') .then(user => { if (!user) return res.status(404).json({ message: "User not found" }); res.json(user); diff --git a/front-end/src/EditProfile.js b/front-end/src/EditProfile.js index 395b945..fa7120f 100644 --- a/front-end/src/EditProfile.js +++ b/front-end/src/EditProfile.js @@ -8,7 +8,6 @@ function EditProfile() { const navigate = useNavigate(); const [userName, setUserName] = useState(""); const [bio, setBio] = useState(""); - const [year, setYear] = useState(""); // Added year state const [oldPassword, setOldPassword] = useState(""); const [newPassword, setNewPassword] = useState(""); const [errorMessage, setErrorMessage] = useState(""); @@ -18,7 +17,6 @@ function EditProfile() { new_password: newPassword, old_password: oldPassword, bio: bio, - year: year, username: userName, }; @@ -62,10 +60,6 @@ function EditProfile() {