removed excess comments
This commit is contained in:
@@ -2,7 +2,6 @@ import { createTRPCProxyClient, httpBatchLink, loggerLink } from "@trpc/client";
|
||||
import type { AppRouter } from "~/server/api/root";
|
||||
|
||||
const getBaseUrl = () => {
|
||||
// Browser: use relative URL
|
||||
if (typeof window !== "undefined") return "";
|
||||
|
||||
const domain = import.meta.env.VITE_DOMAIN;
|
||||
@@ -27,12 +26,10 @@ function getCSRFToken(): string | undefined {
|
||||
|
||||
export const api = createTRPCProxyClient<AppRouter>({
|
||||
links: [
|
||||
// Only enable logging in development mode
|
||||
...(process.env.NODE_ENV === "development"
|
||||
? [
|
||||
loggerLink({
|
||||
enabled: (opts) => {
|
||||
// Suppress 401 UNAUTHORIZED errors from logs
|
||||
const is401 =
|
||||
opts.direction === "down" &&
|
||||
opts.result instanceof Error &&
|
||||
@@ -42,7 +39,6 @@ export const api = createTRPCProxyClient<AppRouter>({
|
||||
})
|
||||
]
|
||||
: []),
|
||||
// identifies what url will handle trpc requests
|
||||
httpBatchLink({
|
||||
url: `${getBaseUrl()}/api/trpc`,
|
||||
headers: () => {
|
||||
|
||||
Reference in New Issue
Block a user