fix(auth): replace .maybeSingle() with .limit(1) to avoid 406 Not Acceptable errors on PostgREST for missing resources

This commit is contained in:
2026-08-19 20:43:38 +00:00
parent 1da0651a88
commit be5e86773b
3 changed files with 15 additions and 12 deletions
+4 -4
View File
@@ -46,14 +46,14 @@ export function UserInfo() {
useEffect(() => {
async function fetchUserProfile() {
if (!user) return;
const { data, error } = await supabase
const { data: profileArr, error } = await supabase
.from('profiles')
.select('full_name, email, profile_image_url')
.eq('id', user.id)
.maybeSingle();
.limit(1);
if (!error && data) {
setProfile(data);
if (!error && profileArr && profileArr.length > 0) {
setProfile(profileArr[0]);
} else {
setProfile({
// eslint-disable-next-line @typescript-eslint/no-explicit-any