/certifications (guarded by certifications.manage) lists cert types with inline create/edit, archive/restore (is_active), and delete (refused server-side once granted). Sidebar gets a Certifications link in the Admin block next to Forms & waivers. Awarding to members is a separate permission handled from the Members page (next phase).
18 lines
666 B
TypeScript
18 lines
666 B
TypeScript
import { requireCertificationsManagerPage } from '@/lib/certifications-guard'
|
|
import { CertificationsClient } from './certifications-client'
|
|
|
|
export const dynamic = 'force-dynamic'
|
|
|
|
export default async function CertificationsPage() {
|
|
const { supabase, member } = await requireCertificationsManagerPage()
|
|
|
|
const { data: certifications } = await supabase
|
|
.from('certifications')
|
|
.select('id, name, description, validity_months, is_active, created_at, updated_at')
|
|
.eq('space_id', member.space_id)
|
|
.order('is_active', { ascending: false })
|
|
.order('name', { ascending: true })
|
|
|
|
return <CertificationsClient initial={certifications ?? []} />
|
|
}
|