Help with express validator

Hi

I am using formData to submit form data and am attaching a profile to the request body.

However both the form data and the profile have the same key “name”

Is it possible to have express-validator just look at form data?

Can we please see first how you are achieving that?

We could then use that to help explore the express-validator issue.

Thanks I think I solved it while walking :slight_smile:

I just did a workaround by extracting the form data with formidable and attaching it to the request body as an object and renaming it to a non matching param. as a middleware step and then performing a check using express validator for all fields at the end - tidy

Also as a simpler option I just renamed the key in my initial data formData.set command … why I didn’t think of that earlier is beyond me!..
But thx!

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.