From 23219d1ffe1273021b59b43e5833064de78c5cd8 Mon Sep 17 00:00:00 2001 From: p2405951 Date: Sun, 8 Mar 2026 18:58:10 +0100 Subject: [PATCH] fix display profile-picture --- src/pages/Profile/ProfilePage.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/Profile/ProfilePage.tsx b/src/pages/Profile/ProfilePage.tsx index eddae6a..3fe6461 100644 --- a/src/pages/Profile/ProfilePage.tsx +++ b/src/pages/Profile/ProfilePage.tsx @@ -66,6 +66,7 @@ function ProfilePage() { useEffect(() => { (async () => { + console.log(JSON.stringify(import.meta.env.VITE_API_URL)); if (!isOwnProfile && id) { const res = await getUserById(id); if (res.status === 404) { @@ -78,10 +79,11 @@ function ProfilePage() { } setProfileUser(res.data); } else { - update(); + //update(); setProfileUser(user); if (user?.profile_photo_path) { setProfilePicture(`${import.meta.env.VITE_API_URL}/storage/${user.profile_photo_path}`); + //setProfilePicture(`${import.meta.env.VITE_API_URL}/${user.profile_photo_path}`); } } })(); @@ -93,7 +95,6 @@ function ProfilePage() { } }; - // Remplacé : handleFileChange extrait vers utils/users/uploadProfilePhoto const handleFileChange = async (e: React.ChangeEvent) => { const file = e.target.files?.[0]; if (!file) return; @@ -102,6 +103,7 @@ function ProfilePage() { const res = await uploadProfilePhoto(file); if (res.ok) { setProfilePicture(`${import.meta.env.VITE_API_URL}/storage/${res.data.profile_photo_path}`); + //setProfilePicture(`${import.meta.env.VITE_API_URL}/${res.data.profile_photo_path}`); setSuccess("Photo mise à jour !"); setError(null); await update();