import { env } from '@/environment'; export async function apiRequest( path: string, init?: RequestInit, ): Promise { const response = await fetch(`${env.backendUrl}${path}`, init); if (!response.ok) { throw new Error(`HTTP ${response.status}`); } return response.json() as Promise; }