From 06b188752f45e51d9047c91e6e2b90e407aa3f14 Mon Sep 17 00:00:00 2001 From: Pattadon Date: Tue, 28 Nov 2023 10:59:05 +0700 Subject: [PATCH] Update profile page component to display username instead of first name --- frontend/src/components/profile/profilePage.jsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/profile/profilePage.jsx b/frontend/src/components/profile/profilePage.jsx index b48912a..b544323 100644 --- a/frontend/src/components/profile/profilePage.jsx +++ b/frontend/src/components/profile/profilePage.jsx @@ -5,18 +5,17 @@ import { useEffect, useState } from "react"; export function ProfileUpdatePage() { const [profile_pic, setProfilePic] = useState(undefined); const [about, setAbout] = useState(); - const [firstName, setFirstname] = useState(); + const [username, setUsernames] = useState(); useEffect(() => { const fetchUser = async () => { try { const response = await axiosInstance.get("/user/data/"); const fetchedProfilePic = response.data.profile_pic; const fetchedAbout = response.data.about; - console.log(fetchedAbout); - const fetchedFirstname = response.data.first_name; + const fetchedUsernames = response.data.username; setProfilePic(fetchedProfilePic); setAbout(fetchedAbout); - setFirstname(fetchedFirstname); + setUsernames(fetchedUsernames); } catch (error) { console.error("Error fetching user:", error); } @@ -27,8 +26,8 @@ export function ProfileUpdatePage() {
-
Firstname
-
{firstName}
+
Username
+
{username}
{/*
User ID
*/}