Finding a stopping point :(
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
import { createClient } from '@/utils/supabase';
|
||||
import type { Profile, Result } from '@/utils/supabase';
|
||||
import { getUser, getProfile, getSignedUrl } from '@/lib/hooks';
|
||||
import { getUser, getOriginalProfile, getSignedUrl } from '@/lib/hooks';
|
||||
|
||||
export type UserWithStatus = {
|
||||
id?: string;
|
||||
@ -67,9 +67,9 @@ export const getRecentUsersWithStatuses = async (): Promise<
|
||||
for (const userWithStatus of filtered) {
|
||||
if (userWithStatus.user.avatar_url)
|
||||
userWithStatus.user.avatar_url =
|
||||
await getAvatarUrl(userWithStatus.updated_by?.avatar_url);
|
||||
await getAvatarUrl(userWithStatus.user.avatar_url);
|
||||
if (userWithStatus.updated_by?.avatar_url)
|
||||
userWithStatus.user.avatar_url =
|
||||
userWithStatus.updated_by.avatar_url =
|
||||
await getAvatarUrl(userWithStatus.updated_by?.avatar_url);
|
||||
filteredWithAvatars.push(userWithStatus);
|
||||
}
|
||||
@ -115,7 +115,7 @@ export const updateStatuses = async (
|
||||
): Promise<Result<void>> => {
|
||||
try {
|
||||
const supabase = createClient();
|
||||
const profileResponse = await getProfile();
|
||||
const profileResponse = await getOriginalProfile();
|
||||
if (!profileResponse.success) throw new Error('Not authenticated!');
|
||||
const user = profileResponse.data;
|
||||
|
||||
@ -155,7 +155,7 @@ export const updateUserStatus = async (
|
||||
): Promise<Result<void>> => {
|
||||
try {
|
||||
const supabase = createClient();
|
||||
const profileResponse = await getProfile();
|
||||
const profileResponse = await getOriginalProfile();
|
||||
if (!profileResponse.success)
|
||||
throw new Error(`Not authenticated! ${profileResponse.error}`);
|
||||
const userProfile = profileResponse.data;
|
||||
|
Reference in New Issue
Block a user