diff --git a/Client/src/Components/Avatar/index.jsx b/Client/src/Components/Avatar/index.jsx index 151914061..98cc01072 100644 --- a/Client/src/Components/Avatar/index.jsx +++ b/Client/src/Components/Avatar/index.jsx @@ -30,7 +30,7 @@ const Avatar = ({ src, small, sx }) => { return ( { ...sx, }} > - {user.firstname?.charAt(0)}{user.lastname?.charAt(0)} + {user.firstName?.charAt(0)}{user.lastName?.charAt(0)} ); }; diff --git a/Client/src/Components/NavBar/index.jsx b/Client/src/Components/NavBar/index.jsx index 354323981..1b3dd8c6a 100644 --- a/Client/src/Components/NavBar/index.jsx +++ b/Client/src/Components/NavBar/index.jsx @@ -150,7 +150,7 @@ function NavBar() {
- {authState.user.firstname} {authState.user.lastname} + {authState.user.firstName} {authState.user.lastName}
{ const { user, authToken, isLoading } = useSelector((state) => state.auth); const idToName = { - "edit-first-name": "firstname", - "edit-last-name": "lastname", + "edit-first-name": "firstName", + "edit-last-name": "lastName", // Disabled for now, will revisit in the future // "edit-email": "email", }; // Local state for form data, errors, and file handling const [localData, setLocalData] = useState({ - firstname: user.firstname, - lastname: user.lastname, + firstName: user.firstName, + lastName: user.lastName, // email: user.email, // Disabled for now }); const [errors, setErrors] = useState({}); @@ -156,8 +156,8 @@ const ProfilePanel = () => { const handleSaveProfile = async (event) => { event.preventDefault(); if ( - localData.firstname === user.firstname && - localData.lastname === user.lastname && + localData.firstName === user.firstName && + localData.lastName === user.lastName && localData.deleteProfileImage === undefined && localData.file === undefined ) { @@ -223,7 +223,7 @@ const ProfilePanel = () => { { id="edit-last-name" placeholder="Enter your last name" autoComplete="family-name" - value={localData.lastname} + value={localData.lastName} onChange={handleChange} error={errors[idToName["edit-last-name"]]} /> diff --git a/Client/src/Features/Auth/authSlice.js b/Client/src/Features/Auth/authSlice.js index f11851d53..2b75c8d33 100644 --- a/Client/src/Features/Auth/authSlice.js +++ b/Client/src/Features/Auth/authSlice.js @@ -47,8 +47,8 @@ export const update = createAsyncThunk( await new Promise((resolve) => setTimeout(resolve, 1500)); const fd = new FormData(); - form.firstname && fd.append("firstname", form.firstname); - form.lastname && fd.append("lastname", form.lastname); + form.firstName && fd.append("firstName", form.firstName); + form.lastName && fd.append("lastName", form.lastName); form.password && fd.append("password", form.password); form.newPassword && fd.append("newPassword", form.newPassword); if (form.file && form.file !== "") { diff --git a/Client/src/Pages/Auth/Register/Register.jsx b/Client/src/Pages/Auth/Register/Register.jsx index 614c47c97..1eaa99f89 100644 --- a/Client/src/Pages/Auth/Register/Register.jsx +++ b/Client/src/Pages/Auth/Register/Register.jsx @@ -22,16 +22,16 @@ const Register = ({ isAdmin }) => { // TODO If possible, change the IDs of these fields to match the backend const idMap = { - "register-firstname-input": "firstname", - "register-lastname-input": "lastname", + "register-firstname-input": "firstName", + "register-lastname-input": "lastName", "register-email-input": "email", "register-password-input": "password", "register-confirm-input": "confirm", }; const [form, setForm] = useState({ - firstname: "", - lastname: "", + firstName: "", + lastName: "", email: "", password: "", confirm: "", @@ -129,9 +129,9 @@ const Register = ({ isAdmin }) => { isRequired={true} placeholder="Daniel" autoComplete="given-name" - value={form.firstname} + value={form.firstName} onChange={handleChange} - error={errors.firstname} + error={errors.firstName} /> { isRequired={true} placeholder="Cojocea" autoComplete="family-name" - value={form.lastname} + value={form.lastName} onChange={handleChange} - error={errors.lastname} + error={errors.lastName} />