I am currently making a router endpoint for inviting members to a group, I don't want to allow a user to invite their own email in the form so I used a zod super refine which passes in the users email and checks it there. I would like to reuse this logic on my router endpoint. However, it doesn't appear like it is possible to expose the request context to the zod input. Is there a way around this? It would be incredibly useful for other types of validation.
sendInvites: groupAdminProcedure .input(createInviteMemberToGroupSchema(ctx.session.user.email)) // no way to access `ctx` .mutation(async ({ ctx, input }) => {
sendInvites: groupAdminProcedure .input(createInviteMemberToGroupSchema(ctx.session.user.email)) // no way to access `ctx` .mutation(async ({ ctx, input }) => {