We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 900bd35 commit 53fbc10Copy full SHA for 53fbc10
1 file changed
src/pages/Profile.tsx
@@ -71,6 +71,23 @@ export function Profile() {
71
const [isMobile, setIsMobile] = useState(false);
72
73
useEffect(() => {
74
+ async function fetchProfile() {
75
+ const { data: { session } } = await supabase.auth.getSession();
76
+ if (!session) return;
77
+ try {
78
+ const res = await fetch('http://localhost:3001/api/profile/summary', {
79
+ headers: { 'Authorization': `Bearer ${session.access_token}` }
80
+ });
81
+ const result = await res.json();
82
+ setData(result);
83
+ } catch (err) {
84
+ console.error('Failed to fetch profile:', err);
85
+ } finally {
86
+ setIsLoading(false);
87
+ }
88
89
+ fetchProfile();
90
+
91
const checkMobile = () => setIsMobile(window.innerWidth < 1024);
92
checkMobile();
93
window.addEventListener('resize', checkMobile);
0 commit comments