I got error PATCH http://localhost:5173/api/users/update/undefined 500 (Internal Server Error) when I click update data at ProfileEditPage
OK let me show the whole picture of this problem. Firstly, I think 5 pages involve in this situation > 1. user.js in backend (logic) 2. userSlice.jsx in redux folder 3. store.jsx in redux folder 4. NewAccountPage 5. ProfileEditPage. Now when I signIn (I use firebase auth) the page will show at NewAccountPage so I click create button then It relocated to ProfileEditPage which brought all of data (username, date, about, profilePicture) to show up in ProfileEditPage perfectly and data saved in database but when I want to update some data it shows PATCH http://localhost:5173/api/users/update/undefined 500 (Internal Server Error) which currentUser._id is undefined when trying to make the API call to update the user profile. let see the code below >>