From 4ff86530ad8449a6609414420ad4014f0601b469 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Sat, 10 Aug 2024 14:29:14 -0700 Subject: [PATCH] more clean up --- eslint.config.mjs | 1 - src/client/links.ts | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index abf9b99..f98edeb 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -21,7 +21,6 @@ export default createConfigForNuxt({ 'vue/multi-word-component-names': 'off', 'vue/no-multiple-template-root': 'off', '@typescript-eslint/no-explicit-any': 'warn', - // '@typescript-eslint/no-unused-var': 'warn' }, }, ) diff --git a/src/client/links.ts b/src/client/links.ts index 3022390..c674fda 100644 --- a/src/client/links.ts +++ b/src/client/links.ts @@ -8,15 +8,17 @@ import { FetchError } from 'ofetch' import type { AnyClientTypes, } from '@trpc/server/unstable-core-do-not-import' -// @ts-expect-error: Nuxt auto-imports import type { AnyTRPCRouter } from '@trpc/server' import type { FetchEsque } from '@trpc/client/dist/internals/types' +// @ts-expect-error: Nuxt auto-imports import { useRequestHeaders } from '#imports' async function customFetch(input: RequestInfo | URL, init?: RequestInit & { method: 'GET' }) { return globalThis.$fetch.raw(input.toString(), init) .catch((e) => { - if (e instanceof FetchError && e.response) { return e.response } + if (e instanceof FetchError && e.response) { + return e.response + } throw e }) .then(response => ({