mirror of
https://github.com/ArthurDanjou/trpc-nuxt.git
synced 2026-01-14 12:14:40 +01:00
cleanup
This commit is contained in:
@@ -6,33 +6,6 @@ import type { AppRouter } from '~~/server/trpc/routers'
|
|||||||
|
|
||||||
export default defineNuxtPlugin(() => {
|
export default defineNuxtPlugin(() => {
|
||||||
const headers = useRequestHeaders()
|
const headers = useRequestHeaders()
|
||||||
// const client = createTRPCProxyClient<AppRouter>({
|
|
||||||
// transformer: superjson,
|
|
||||||
// links: [
|
|
||||||
// // adds pretty logs to your console in development and logs errors in production
|
|
||||||
// loggerLink({
|
|
||||||
// enabled: opts =>
|
|
||||||
// process.env.NODE_ENV === 'development' ||
|
|
||||||
// (opts.direction === 'down' && opts.result instanceof Error)
|
|
||||||
// }),
|
|
||||||
// httpBatchLink({
|
|
||||||
// url: '/api/trpc',
|
|
||||||
// headers () {
|
|
||||||
// return headers
|
|
||||||
// },
|
|
||||||
// fetch: (input, options) =>
|
|
||||||
// globalThis.$fetch.raw(input.toString(), options)
|
|
||||||
// .catch((e) => {
|
|
||||||
// if (e instanceof FetchError && e.response) { return e.response }
|
|
||||||
// throw e
|
|
||||||
// })
|
|
||||||
// .then(response => ({
|
|
||||||
// ...response,
|
|
||||||
// json: () => Promise.resolve(response._data)
|
|
||||||
// }))
|
|
||||||
// })
|
|
||||||
// ]
|
|
||||||
// })
|
|
||||||
const client = createTRPCNuxtClient<AppRouter>({
|
const client = createTRPCNuxtClient<AppRouter>({
|
||||||
transformer: superjson,
|
transformer: superjson,
|
||||||
links: [
|
links: [
|
||||||
|
|||||||
Reference in New Issue
Block a user