allow passing of other client options

This commit is contained in:
Robert Soriano
2022-10-30 21:13:54 -07:00
parent 3b0609e395
commit a614bc588e
2 changed files with 6 additions and 5 deletions

View File

@@ -30,11 +30,12 @@ function createNuxtProxyDecoration<TRouter extends AnyRouter>(name: string, clie
const path = pathCopy.join('.')
// @ts-expect-error: Additional options
const [input, { trpc, ...asyncDataOptions }] = args
const [input, otherOptions] = args
const queryKey = getQueryKey(path, input)
const { trpc, ...asyncDataOptions } = otherOptions || {} as any
return useAsyncDataWithError(queryKey, () => (client as any)[path][lastArg](input, trpc), asyncDataOptions)
})
}