rest API added

This commit is contained in:
gitea
2026-02-14 15:13:26 +01:00
parent c8ff07b490
commit d99b051a07
30 changed files with 1872 additions and 616 deletions
+4 -3
View File
@@ -2,6 +2,7 @@
import { onMount } from 'svelte';
import { push } from 'svelte-spa-router';
import { auth } from '../lib/stores/auth.js';
import { supabase } from '../lib/supabase.js';
import { getProfile, updateProfile, uploadAvatar } from '../lib/api/profile.js';
let profile = null;
@@ -29,7 +30,7 @@
loading = true;
error = null;
try {
profile = await getProfile(userId);
profile = await getProfile(supabase, userId);
displayName = profile?.display_name ?? '';
avatarPreview = profile?.avatar_url ?? null;
} catch (e) {
@@ -73,11 +74,11 @@
} else if (avatarPreview === null && profile?.avatar_url) {
avatarUrl = null;
}
await updateProfile(userId, {
await updateProfile(supabase, userId, {
display_name: displayName.trim() || null,
avatar_url: avatarUrl,
});
profile = await getProfile(userId);
profile = await getProfile(supabase, userId);
displayName = profile?.display_name ?? '';
avatarPreview = profile?.avatar_url ?? null;
avatarFile = null;