// ============================================================================= // RBAC API HELPERS // ============================================================================= export const API = '/api/sdk/v1/rbac' export async function apiFetch(path: string, opts?: RequestInit): Promise { 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', }) }