Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matched Data should return the location #1134

Open
olawalejuwonm opened this issue Feb 24, 2022 · 2 comments
Open

Matched Data should return the location #1134

olawalejuwonm opened this issue Feb 24, 2022 · 2 comments

Comments

@olawalejuwonm
Copy link

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

matchedData(req[, options]) should return a location

@gustavohenke
Copy link
Member

The purpose of matchedData is to return an object which you can directly pass to your own code, but you can definitely pick the data from specific locations.
E.g. see the docs https://express-validator.github.io/docs/matched-data-api.html#gathering-data-from-multiple-locations

How do you expect the shape of the return to look if it was to include the location?

@olawalejuwonm
Copy link
Author

It should look like this [{ page: '1' , location: 'query'}] location can be query, body, param etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants