From 1f7a92515231b93515e0400117e4f396ec785543 Mon Sep 17 00:00:00 2001 From: theonlytails Date: Wed, 6 Mar 2024 18:38:52 +0200 Subject: [PATCH] fixed client function types --- api/src/lib/client.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/api/src/lib/client.ts b/api/src/lib/client.ts index d36fcb6f07..310d05940e 100644 --- a/api/src/lib/client.ts +++ b/api/src/lib/client.ts @@ -1,15 +1,14 @@ import { hc } from "hono/client"; import type { AppType } from "$server"; -export const client = ({ - baseUrl = "https://api.linku.la/", - fetchFunc = fetch, -}: { - baseUrl: string; - fetchFunc: typeof fetch; -}) => - hc(baseUrl, { - fetch: fetchFunc, +export const client = (args?: { + baseUrl?: string; + fetch?: typeof fetch; +}) => { + const { baseUrl, fetch } = args; + return hc(baseUrl, { + fetch }); +}; export type ApiType = AppType;