Calling imperatively from controller does not work
See original GitHub issueHello:
I’m trying to use express-validator imperative call in a controller as described in here. https://express-validator.github.io/docs/running-imperatively.html .
My code:
var myMethod = async function (req, res, next) {
await body('email').isEmail().run(req);
var errors = validationResult(req);
console.log(errors);
}
The console will log an empty array if email is not present or email is invalid.
This code belongs to a controller, if I use the validation chain as a middleware it works as expected.
Thanks in advance.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Error calling Apex imperatively from LWC in a JavaScript ...
But for some special reasons, I keep on getting this error on my browser "[F.default(...).then(...).error is not a function]" can anyone help ...
Read more >Call Apex Methods Imperatively - Salesforce Developers
To work with objects that aren't supported by User Interface API, like Task and Event. To call a method from an ES6 module...
Read more >Understand async & await scenarios in Lightning Web ...
Understand async & await scenarios in Lightning Web Component which helps you to control imperative public apex method calls.
Read more >Calling the apex Method using imperative way LWC
Things to remember before you call apex method with imperative in LWC. Apex controller method should be static; It should annotated with @AuraEnable....
Read more >LWC - Call Apex Imperatively - YouTube
1 Salesforce Training Tutorialshttps://www.sown.ioAn alternative to calling Apex with @wire is to call Apex imperatively.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
👋 this has been published to
v6.1.0
🚢Thanks @gustavohenke great response time. Will look at some issues to see on what can I help you.