fix(api): fix api endpoint logic #3

This commit is contained in:
shafin-r
2025-08-17 14:08:17 +06:00
parent ad46bf954e
commit 4f23f357e6
7 changed files with 87 additions and 69 deletions

View File

@ -53,7 +53,7 @@ const Header = ({
const token = await getToken();
if (!token) return;
const response = await fetch(`${API_URL}/me`, {
const response = await fetch(`${API_URL}/me/`, {
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
@ -100,11 +100,13 @@ const Header = ({
<div className={styles.profile}>
<Avatar className="bg-gray-200 w-10 h-10">
<AvatarFallback className=" text-lg">
{userData?.name ? userData.name.charAt(0).toUpperCase() : ""}
{userData?.username
? userData.username.charAt(0).toUpperCase()
: ""}
</AvatarFallback>
</Avatar>
<span className={styles.text}>
Hello, {userData?.name ? userData.name.split(" ")[0] : ""}
Hello, {userData?.username ? userData.username.split(" ")[0] : ""}
</span>
</div>
)}