Cleanup
This commit is contained in:
25
apps/web/app/admin/users/queries.ts
Normal file
25
apps/web/app/admin/users/queries.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import getSupabaseServerComponentClient from '@packages/supabase/server-component-client';
|
||||
|
||||
import { USERS_TABLE } from '@/lib/db-tables';
|
||||
|
||||
export async function getUsers(ids: string[]) {
|
||||
const client = getSupabaseServerComponentClient({ admin: true });
|
||||
|
||||
const { data: users, error } = await client
|
||||
.from(USERS_TABLE)
|
||||
.select(
|
||||
`
|
||||
id,
|
||||
photoURL: photo_url,
|
||||
displayName: display_name,
|
||||
onboarded
|
||||
`,
|
||||
)
|
||||
.in('id', ids);
|
||||
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return users;
|
||||
}
|
||||
Reference in New Issue
Block a user