feat: add partner list and customer list explorer to admin settings
All checks were successful
Staging Build / build (push) Successful in 2m19s

This commit is contained in:
DanielS
2026-06-24 00:02:27 +02:00
parent bdbf840529
commit 7b22889e23
3 changed files with 325 additions and 9 deletions

View File

@@ -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))
}