feat: add partner list and customer list explorer to admin settings
All checks were successful
Staging Build / build (push) Successful in 2m19s
All checks were successful
Staging Build / build (push) Successful in 2m19s
This commit is contained in:
@@ -48,3 +48,18 @@ export async function resetPassword(email: string) {
|
||||
if (error) throw error
|
||||
// Usually you'd send this link or let Supabase handle it via regular auth.resetPasswordForEmail
|
||||
}
|
||||
|
||||
export async function getPartners() {
|
||||
const admin = createAdminClient()
|
||||
const { data: { users }, error } = await admin.auth.admin.listUsers()
|
||||
if (error) throw error
|
||||
|
||||
const { data: dbUsers, error: dbError } = await admin
|
||||
.from('users')
|
||||
.select('id, role')
|
||||
.eq('role', 'partner')
|
||||
if (dbError) throw dbError
|
||||
|
||||
const partnerIds = new Set(dbUsers.map(u => u.id))
|
||||
return users.filter(u => partnerIds.has(u.id))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user