From 460ea7f65cacd11b82317e5f8edda4180878bb1d Mon Sep 17 00:00:00 2001 From: Yujin Hong Date: Sun, 28 Apr 2024 18:01:06 -0400 Subject: [PATCH] fixed profile css, edit profile questions --- back-end/App.js | 2 +- front-end/src/EditProfile.js | 6 ------ front-end/src/OtherProfile.css | 15 +++++++++++++++ front-end/src/OtherProfile.js | 13 ++++--------- front-end/src/Profile.css | 8 ++++++++ front-end/src/Profile.js | 7 ++++++- 6 files changed, 34 insertions(+), 17 deletions(-) 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() {