import { edenFetch } from "elysia/eden"; import { Api } from "../api/serveApi.ts"; export const fetchApi = edenFetch(`${location.origin}/api`); export function handleResponse( response: { data: D; error: E }, ): NonNullable { if (response.data) { return response.data; } throw new Error(String(response.error)); }