1- import { IRouter , RequestHandler } from 'express' ;
1+ import { IRouter , Request , Response } from 'express' ;
22import { IncomingHttpHeaders } from 'http' ;
33import {
44 AppRoute ,
@@ -110,12 +110,10 @@ const transformAppRouteQueryImplementation = (
110110 } ) ;
111111 }
112112
113- const result = await route ( {
113+ const result = await route ( { // @ts -ignore
114114 params : req . params ,
115115 query : req . query ,
116116 headers : req . headers ,
117-
118- // @ts -expect-error because the decorator shape is any
119117 req : req ,
120118 } ) ;
121119
@@ -133,7 +131,7 @@ const transformAppRouteMutationImplementation = (
133131
134132 const method = schema . method ;
135133
136- const callback : RequestHandler = async ( req , res ) => {
134+ const callback = async ( req : Request , res : Response ) => {
137135 try {
138136 const zodBodyIssues = returnZodErrorsIfZodSchema ( schema . body , req . body ) ;
139137
@@ -155,6 +153,8 @@ const transformAppRouteMutationImplementation = (
155153 }
156154
157155 const result = await route ( {
156+
157+ // @ts -ignore
158158 params : req . params ,
159159 body : req . body ,
160160 query : req . query ,
@@ -165,7 +165,6 @@ const transformAppRouteMutationImplementation = (
165165 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
166166 // @ts -ignore
167167 file : req . file ,
168- // @ts -expect-error because the decorator shape is any
169168 req : req ,
170169 } ) ;
171170
@@ -189,9 +188,6 @@ const transformAppRouteMutationImplementation = (
189188 case 'PATCH' :
190189 app . patch ( schema . path , callback ) ;
191190 break ;
192- default :
193- // eslint-disable-next-line no-case-declarations, @typescript-eslint/no-unused-vars
194- const _exhaustiveCheck : never = method ;
195191 }
196192} ;
197193
0 commit comments