Browse Source
Update frontend/src/pages/Account.jsx
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
features/create-channel
Sacha GUERIN
5 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
1 deletions
-
frontend/src/pages/Account.jsx
|
|
@ -38,6 +38,10 @@ export default function Account() { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
const fetchUserHistory = async () => { |
|
|
const fetchUserHistory = async () => { |
|
|
|
|
|
if (!user.id || !token) { |
|
|
|
|
|
console.warn("User ID or token missing, skipping history fetch"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
try { |
|
|
try { |
|
|
const response = await fetch(`/api/users/${user.id}/history`, { |
|
|
const response = await fetch(`/api/users/${user.id}/history`, { |
|
|
method: "GET", |
|
|
method: "GET", |
|
|
@ -52,7 +56,6 @@ export default function Account() { |
|
|
setUserHistory(data); |
|
|
setUserHistory(data); |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error("Error fetching user history:", error); |
|
|
console.error("Error fetching user history:", error); |
|
|
return null; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
const fetchUserPlaylists = async () => { |
|
|
const fetchUserPlaylists = async () => { |
|
|
|