feat(certifications): admin cert-type pages + sidebar nav
/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).
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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 ?? []} />
|
||||
}
|
||||
Reference in New Issue
Block a user