(api) Add CRUD typebot endpoints

Closes #320, closes #696
This commit is contained in:
Baptiste Arnaud
2023-08-17 09:39:11 +02:00
parent 019f72ac7e
commit 454d320c6b
78 changed files with 25014 additions and 1073 deletions

View File

@@ -1,4 +1,4 @@
import { httpBatchLink, loggerLink } from '@trpc/client'
import { createTRPCProxyClient, httpBatchLink, loggerLink } from '@trpc/client'
import { createTRPCNext } from '@trpc/next'
import type { AppRouter } from '../helpers/server/routers/v1/trpcRouter'
import superjson from 'superjson'
@@ -26,6 +26,15 @@ export const trpc = createTRPCNext<AppRouter>({
ssr: false,
})
export const trpcVanilla = createTRPCProxyClient<AppRouter>({
links: [
httpBatchLink({
url: `${getBaseUrl()}/api/trpc`,
}),
],
transformer: superjson,
})
export const defaultQueryOptions = {
refetchOnMount: env('E2E_TEST') === 'true',
}