I have a few route like this:
app.post('/user/me', c.auth, c.striper.make, c.user.edit, c.user.requestDriver, render);
app.post('/user/:id', c.auth, c.targetUser, c.user.makeDriver, c.user.makeAdmin, render);
When the validation fails, I want to skip all middlewear and go run the render-function, with req, res I can't use next();
for this because I don't know where in the order I am, is there some other way to call a specific function with the parameters res, req and next();
(my validation doesn't have access to those parameters so I can't just do
render(res, req, next)
Maybe some way to replace the middlewear setup in routes.