diff --git a/server/src/middlewares/upload.ts b/server/src/middlewares/upload.ts index 76fc33211..1e0fb2363 100644 --- a/server/src/middlewares/upload.ts +++ b/server/src/middlewares/upload.ts @@ -8,18 +8,12 @@ import config from '~/infra/config'; import BadRequestError from '~/errors/badRequestError'; export function upload(): RequestHandler { - - const ALLOWED_MIMES = [ - 'image/png', - 'image/jpeg', - 'application/pdf', - ]; + const ALLOWED_MIMES = ['image/png', 'image/jpeg', 'application/pdf']; const upload = multer({ limits: { files: 1, fileSize: 1024 * 1024 * 5 // 5 MB }, - // @ts-expect-error: Due to express-server-static-core weird type augmentation fileFilter( request: Request, file: Express.Multer.File, @@ -50,6 +44,5 @@ export function upload(): RequestHandler { }) }); - // @ts-expect-error: Due to express-server-static-core weird type augmentation return upload.single('file'); } diff --git a/server/src/routers/protected.ts b/server/src/routers/protected.ts index 917cb2a2c..0d8acea0a 100644 --- a/server/src/routers/protected.ts +++ b/server/src/routers/protected.ts @@ -281,7 +281,6 @@ router.get( // TODO: should be /geo-perimeters router.get('/geo/perimeters', geoController.listGeoPerimeters); -// @ts-expect-error: should be fixed later router.post('/geo/perimeters', fileUpload(), geoController.createGeoPerimeter); router.put( '/geo/perimeters/:geoPerimeterId',