Skip to content

Commit

Permalink
fixed client function types
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOnlyTails committed Mar 6, 2024
1 parent 8ca1a94 commit 1f7a925
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions api/src/lib/client.ts
Original file line number Diff line number Diff line change
@@ -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<AppType>(baseUrl, {
fetch: fetchFunc,
export const client = (args?: {
baseUrl?: string;
fetch?: typeof fetch;
}) => {
const { baseUrl, fetch } = args;
return hc<AppType>(baseUrl, {
fetch
});
};

export type ApiType = AppType;

0 comments on commit 1f7a925

Please sign in to comment.