Refactor: Use RPC for user data

This commit is contained in:
gpt-engineer-app[bot]
2025-10-30 18:36:45 +00:00
parent bcbb8019bd
commit a5d0d2253e
4 changed files with 36 additions and 30 deletions

View File

@@ -69,10 +69,10 @@ export function ReassignDialog({
const userIds = roles.map((r) => r.user_id);
const { data: profiles, error: profilesError } = await supabase
.from('profiles')
.select('user_id, username, display_name')
.in('user_id', userIds);
const { data: allProfiles, error: profilesError } = await supabase
.rpc('get_users_with_emails');
const profiles = allProfiles?.filter(p => userIds.includes(p.user_id));
if (profilesError) throw profilesError;