Skip to content

Commit

Permalink
fix: pass all arguments to proxied trpc client method
Browse files Browse the repository at this point in the history
  • Loading branch information
robinWongM authored Mar 17, 2023
1 parent 7a69573 commit 6595a1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function createNuxtProxyDecoration<TRouter extends AnyRouter> (name: stri
}), asyncDataOptions)
}

return (client as any)[path][lastArg](input)
return (client as any)[path][lastArg](...args)
})
}

Expand Down

1 comment on commit 6595a1d

@JavascriptMick
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @robinWongM, pretty sure this bugfix is what I have needed to fix issues in my app. I have been tearing my hair out and was close to rage-quitting nuxt altogether. Essentially, I am using TRPC and Supabase and fetching the supabase user in my context.ts...

export async function createContext(event: H3Event){
  let user: User | null = null;
  if (!user) {
    user = await serverSupabaseUser(event);
    .... etc

...but intermittently, the user was coming back as null, presumeably because serverSupabaseUser was not getting the subabase key/refresh key via the cookie. This is apparently working now after upgrading to v0.8.0

Please sign in to comment.