chore: format
This commit is contained in:
@@ -1,25 +1,25 @@
|
||||
import { createTRPCClient, httpBatchLink } from "@trpc/client"
|
||||
import { createTRPCReact } from "@trpc/react-query"
|
||||
import { createTRPCClient, httpBatchLink } from "@trpc/client";
|
||||
import { createTRPCReact } from "@trpc/react-query";
|
||||
|
||||
import type { AppRouter } from "backend"
|
||||
import { constants } from "./constants"
|
||||
import Cookies from "js-cookie"
|
||||
import SuperJSON from "superjson"
|
||||
import type { AppRouter } from "backend";
|
||||
import { constants } from "./constants";
|
||||
import Cookies from "js-cookie";
|
||||
import SuperJSON from "superjson";
|
||||
|
||||
export const trpc = createTRPCReact<AppRouter>()
|
||||
export const trpc = createTRPCReact<AppRouter>();
|
||||
|
||||
export const trpcClient = createTRPCClient<AppRouter>({
|
||||
links: [
|
||||
httpBatchLink({
|
||||
url: `${constants.VITE_API_URL}/trpc`,
|
||||
async headers() {
|
||||
return {
|
||||
authorization: Cookies.get("token")
|
||||
? `Bearer ${Cookies.get("token")}`
|
||||
: undefined,
|
||||
}
|
||||
},
|
||||
transformer: SuperJSON,
|
||||
}),
|
||||
],
|
||||
})
|
||||
links: [
|
||||
httpBatchLink({
|
||||
url: `${constants.VITE_API_URL}/trpc`,
|
||||
async headers() {
|
||||
return {
|
||||
authorization: Cookies.get("token")
|
||||
? `Bearer ${Cookies.get("token")}`
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
transformer: SuperJSON,
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user