feat: add lock/unlock button to partner table in Einstellungen
All checks were successful
Staging Build / build (push) Successful in 2m34s

This commit is contained in:
DanielS
2026-06-24 17:05:16 +02:00
parent cd04309e3e
commit 6b66cc5c41
2 changed files with 65 additions and 17 deletions

View File

@@ -91,9 +91,14 @@ export async function getPartners() {
const { data: dbUsers, error: dbError } = await admin
.from('users')
.select('id, role')
.eq('role', 'partner')
.in('role', ['partner', 'gesperrt'])
if (dbError) throw dbError
const roleMap: Record<string, string> = {}
dbUsers.forEach(u => { roleMap[u.id] = u.role })
const partnerIds = new Set(dbUsers.map(u => u.id))
return users.filter(u => partnerIds.has(u.id))
return users
.filter(u => partnerIds.has(u.id))
.map(u => ({ ...u, role: roleMap[u.id] || 'partner' }))
}