mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
fix: bump trpc and openapi packages (#1591)
This commit is contained in:
@ -1,7 +0,0 @@
|
||||
import { TRPCClientError } from '@trpc/client';
|
||||
|
||||
import { AppRouter } from '../server/router';
|
||||
|
||||
export const isTRPCBadRequestError = (err: unknown): err is TRPCClientError<AppRouter> => {
|
||||
return err instanceof TRPCClientError && err.shape?.code === 'BAD_REQUEST';
|
||||
};
|
||||
@ -1,24 +1,22 @@
|
||||
import { createTRPCProxyClient, httpBatchLink, httpLink, splitLink } from '@trpc/client';
|
||||
import { createTRPCClient, httpBatchLink, httpLink, splitLink } from '@trpc/client';
|
||||
import SuperJSON from 'superjson';
|
||||
|
||||
import { getBaseUrl } from '@documenso/lib/universal/get-base-url';
|
||||
|
||||
import type { AppRouter } from '../server/router';
|
||||
|
||||
export const trpc = createTRPCProxyClient<AppRouter>({
|
||||
transformer: SuperJSON,
|
||||
|
||||
export const trpc = createTRPCClient<AppRouter>({
|
||||
links: [
|
||||
splitLink({
|
||||
condition: (op) => op.context.skipBatch === true,
|
||||
true: httpLink({
|
||||
url: `${getBaseUrl()}/api/trpc`,
|
||||
transformer: SuperJSON,
|
||||
}),
|
||||
false: httpBatchLink({
|
||||
url: `${getBaseUrl()}/api/trpc`,
|
||||
transformer: SuperJSON,
|
||||
}),
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
export { TRPCClientError } from '@trpc/client';
|
||||
|
||||
Reference in New Issue
Block a user