Theo's Typesafe CultTTC
Theo's Typesafe Cult4y ago
11 replies
brr

trying to access req and res in trpc query

I need to access res to set a header.
I tried accessing req and res from ctx but only session and prisma are available.
Any ideas? I tried looking it up but didn't really get anywhere
export const filesRouter = router({
  getPreSignedUrl: protectedProcedure
    .input(
      z.object({
        fileName: z.string().min(1),
      })
    )
    .query(async ({ ctx, input }) => {
      console.log("in");
      console.log(ctx);
    ...
Was this page helpful?