Files
2026-02-26 21:29:34 +01:00

11 lines
304 B
TypeScript

import type { $Fetch, SearchParameters } from 'ofetch';
export async function fetchWithRepo<T>(
fetcher: $Fetch,
url: string,
method: 'GET' | 'POST' | 'PUT' | 'DELETE' = 'GET',
body?: any,
params?: SearchParameters
): Promise<T> {
return await fetcher(url, { method, body, params });
}