General fixes. Still far from good or working

This commit is contained in:
2026-01-11 13:21:01 -05:00
parent 0a361f51a1
commit 67daefb919
83 changed files with 733 additions and 1053 deletions

View File

@@ -1,12 +1,11 @@
import { QueryClient } from "@tanstack/react-query";
import { createTRPCClient, httpBatchLink, loggerLink } from "@trpc/client";
import { createTRPCOptionsProxy } from "@trpc/tanstack-react-query";
import superjson from "superjson";
import type { AppRouter } from '@acme/api';
import { QueryClient } from '@tanstack/react-query';
import { createTRPCClient, httpBatchLink, loggerLink } from '@trpc/client';
import { createTRPCOptionsProxy } from '@trpc/tanstack-react-query';
import superjson from 'superjson';
import type { AppRouter } from "@acme/api";
import { authClient } from "./auth";
import { getBaseUrl } from "./base-url";
import { authClient } from './auth';
import { getBaseUrl } from './base-url';
export const queryClient = new QueryClient({
defaultOptions: {
@@ -24,20 +23,20 @@ export const trpc = createTRPCOptionsProxy<AppRouter>({
links: [
loggerLink({
enabled: (opts) =>
process.env.NODE_ENV === "development" ||
(opts.direction === "down" && opts.result instanceof Error),
colorMode: "ansi",
process.env.NODE_ENV === 'development' ||
(opts.direction === 'down' && opts.result instanceof Error),
colorMode: 'ansi',
}),
httpBatchLink({
transformer: superjson,
url: `${getBaseUrl()}/api/trpc`,
headers() {
const headers = new Map<string, string>();
headers.set("x-trpc-source", "expo-react");
headers.set('x-trpc-source', 'expo-react');
const cookies = authClient.getCookie();
if (cookies) {
headers.set("Cookie", cookies);
headers.set('Cookie', cookies);
}
return headers;
},
@@ -47,4 +46,4 @@ export const trpc = createTRPCOptionsProxy<AppRouter>({
queryClient,
});
export type { RouterInputs, RouterOutputs } from "@acme/api";
export type { RouterInputs, RouterOutputs } from '@acme/api';