My validator code isn't working properly


#1

If I comment out the if block below I can submit a post; otherwise nothing happens; the form data can not be submitted with the current state of the code, particularly that validator part.
if (validation.fails()) {
session.withErrors(validation.messages()).flashAll();
return response.redirect(‘back’); // reload the page
}
Here’s the rest of the code in the PostController: https://pastebin.com/uHD2HtuN


#2

What is the message if you console.log(session.withErrors(validation.messages()).flashAll());

or console.log(validation.messages());