refactor(admin): split loeschfristen and vvt pages
Reduce both page.tsx files below the 500-LOC hard cap by extracting all inline tab components and API helpers into colocated _components/. - loeschfristen/page.tsx: 2720 → 467 LOC - vvt/page.tsx: 2297 → 256 LOC New files: LoeschkonzeptTab, loeschfristen/api, TabDokument, TabProcessor Updated: TabVerzeichnis (template picker + badge), vvt/api (template helpers) Fixed: VVTLinkSection wrong field name (linkedVVTActivityIds), VendorLinkSection added Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -138,3 +138,25 @@ export async function apiUpsertOrganization(org: VVTOrganizationHeader): Promise
|
||||
if (!res.ok) throw new Error(`PUT organization failed: ${res.status}`)
|
||||
return orgHeaderFromApi(await res.json())
|
||||
}
|
||||
|
||||
export interface ProcessTemplate {
|
||||
id: string; name: string; description?: string; business_function: string
|
||||
purpose_refs: string[]; legal_basis_refs: string[]; data_subject_refs: string[]
|
||||
data_category_refs: string[]; recipient_refs: string[]; tom_refs: string[]
|
||||
retention_rule_ref?: string; typical_systems: string[]
|
||||
protection_level: string; dpia_required: boolean; risk_score?: number
|
||||
tags: string[]; sort_order: number
|
||||
}
|
||||
|
||||
export async function apiListTemplates(businessFunction?: string): Promise<ProcessTemplate[]> {
|
||||
const params = businessFunction ? `?business_function=${businessFunction}` : ''
|
||||
const res = await fetch(`${VVT_API_BASE}/templates${params}`)
|
||||
if (!res.ok) return []
|
||||
return res.json()
|
||||
}
|
||||
|
||||
export async function apiInstantiateTemplate(templateId: string): Promise<VVTActivity> {
|
||||
const res = await fetch(`${VVT_API_BASE}/templates/${templateId}/instantiate`, { method: 'POST' })
|
||||
if (!res.ok) throw new Error(`POST instantiate failed: ${res.status}`)
|
||||
return activityFromApi(await res.json())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user