generated from muhtadeetaron/nextjs-template
fix(api): fix api endpoint logic #3
This commit is contained in:
@ -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>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user