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

@@ -1,6 +1,7 @@
'use server'
import { createClient } from '@/lib/supabase/server'
import { createAdminClient } from '@/lib/supabase/admin'
import { revalidatePath } from 'next/cache'
import type { EndCustomer } from '@/lib/types'
@@ -143,3 +144,15 @@ export async function anonymizeEndCustomer(id: string): Promise<void> {
revalidatePath('/my-customers')
revalidatePath(`/my-customers/${id}`)
}
export async function getPartnerEndCustomers(partnerId: string): Promise<EndCustomer[]> {
const admin = createAdminClient()
const { data, error } = await admin
.from('end_customers')
.select('*')
.eq('partner_id', partnerId)
.order('company_name', { ascending: true })
if (error) throw error
return data as EndCustomer[]
}