refactor(admin): split rbac page.tsx into colocated components
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
23
admin-compliance/app/sdk/rbac/_api.ts
Normal file
23
admin-compliance/app/sdk/rbac/_api.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
// =============================================================================
|
||||
// RBAC API HELPERS
|
||||
// =============================================================================
|
||||
|
||||
export const API = '/api/sdk/v1/rbac'
|
||||
|
||||
export async function apiFetch<T>(path: string, opts?: RequestInit): Promise<T> {
|
||||
const res = await fetch(`${API}/${path}`, {
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
...opts,
|
||||
})
|
||||
if (!res.ok) {
|
||||
const err = await res.text()
|
||||
throw new Error(`HTTP ${res.status}: ${err}`)
|
||||
}
|
||||
return res.json()
|
||||
}
|
||||
|
||||
export function formatDate(iso: string): string {
|
||||
return new Date(iso).toLocaleString('de-DE', {
|
||||
day: '2-digit', month: '2-digit', year: 'numeric',
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user