reinstall deps

This commit is contained in:
wobsoriano
2022-11-04 07:55:39 -07:00
parent 2f7a1276ad
commit 347d49482f
2 changed files with 17 additions and 256 deletions

View File

@@ -51,25 +51,14 @@ export async function useAsyncQuery<
): Promise<AsyncData<PickFrom<ReturnType<Transform>, PickKeys>, TError>> {
const { $client } = useNuxtApp()
const key = getQueryKey(pathAndInput)
const serverError = useState<TError | null>(`error-${key}`, () => null)
const { error, data, ...rest } = await useAsyncData(
const result = await useAsyncData(
key,
() => $client.query(...pathAndInput),
// @ts-expect-error: Internal
options,
)
if (error.value && !serverError.value)
serverError.value = error.value as any
if (data.value)
serverError.value = null
return {
...rest,
data,
error: serverError,
} as any
return result
}
export function useClient(): TRPCClient<AppRouter> {