mirror of
https://github.com/ArthurDanjou/trpc-nuxt.git
synced 2026-01-14 12:14:40 +01:00
refactor: rename endpoint option
This commit is contained in:
@@ -61,7 +61,7 @@ export default defineNuxtModule<ModuleOptions>({
|
||||
|
||||
export default createTRPCHandler({
|
||||
...functions,
|
||||
trpcURL: '${finalConfig.trpcURL}'
|
||||
endpoint: '${finalConfig.trpcURL}'
|
||||
})
|
||||
`
|
||||
},
|
||||
|
||||
@@ -42,13 +42,13 @@ export function createTRPCHandler<Router extends AnyRouter>({
|
||||
createContext,
|
||||
responseMeta,
|
||||
onError,
|
||||
trpcURL,
|
||||
endpoint,
|
||||
}: {
|
||||
router: Router
|
||||
createContext?: CreateContextFn<Router>
|
||||
responseMeta?: ResponseMetaFn<Router>
|
||||
onError?: OnErrorFn<Router>
|
||||
trpcURL: string
|
||||
endpoint: string
|
||||
}) {
|
||||
return defineEventHandler(async (event) => {
|
||||
const {
|
||||
@@ -66,7 +66,7 @@ export function createTRPCHandler<Router extends AnyRouter>({
|
||||
body: isMethod(event, 'GET') ? null : await useBody(event),
|
||||
query: $url.searchParams,
|
||||
},
|
||||
path: $url.pathname.substring(trpcURL.length + 1),
|
||||
path: $url.pathname.substring(endpoint.length + 1),
|
||||
createContext: async () => createContext?.(event),
|
||||
responseMeta,
|
||||
onError: (o) => {
|
||||
|
||||
Reference in New Issue
Block a user