diff --git a/packages/utils/http.ts b/packages/utils/http.ts index 28c0d1a..ca1e835 100644 --- a/packages/utils/http.ts +++ b/packages/utils/http.ts @@ -2,6 +2,21 @@ const baseHeaders: HeadersInit = { "Content-Type": "application/json", }; +export async function get( + url: string, + options?: Omit, +): Promise { + const resp = await fetch(url, { + method: "GET", + ...options, + headers: { + ...baseHeaders, + ...options?.headers, + }, + }); + return (await resp.json()) as TResponse; +} + export async function post( url: string, options?: Omit,