DEV Community

Discussion on: A Clean Approach to Using Express Validator

Collapse
 
geepalik profile image
Gil Palikaras • Edited

Hi Chinedu,

Thank you for the solution, looks great and works great.
I am using PHPStorm/WebStorm and when I implemented this solution, the editor shows warning (yellow underline):
Argument types do not match parameters

const {studentValidationRules, validate} = require('../util/dataValidator');
router.post('/student', studentValidationRules(), validate ,studentController.createStudent);

error

I thought I was using correctly the pattern of adding middleware to my routes, did I do something wrong?