mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
feat: add template and field endpoints (#1572)
This commit is contained in:
@ -35,9 +35,10 @@ export const trpc = createTRPCReact<AppRouter>({
|
||||
|
||||
export interface TrpcProviderProps {
|
||||
children: React.ReactNode;
|
||||
headers?: Record<string, string>;
|
||||
}
|
||||
|
||||
export function TrpcProvider({ children }: TrpcProviderProps) {
|
||||
export function TrpcProvider({ children, headers }: TrpcProviderProps) {
|
||||
let queryClientConfig: QueryClientConfig | undefined;
|
||||
|
||||
const isDevelopingOffline =
|
||||
@ -63,15 +64,16 @@ export function TrpcProvider({ children }: TrpcProviderProps) {
|
||||
const [trpcClient] = useState(() =>
|
||||
trpc.createClient({
|
||||
transformer: SuperJSON,
|
||||
|
||||
links: [
|
||||
splitLink({
|
||||
condition: (op) => op.context.skipBatch === true,
|
||||
true: httpLink({
|
||||
url: `${getBaseUrl()}/api/trpc`,
|
||||
headers,
|
||||
}),
|
||||
false: httpBatchLink({
|
||||
url: `${getBaseUrl()}/api/trpc`,
|
||||
headers,
|
||||
}),
|
||||
}),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user