fix error on email validation failure
This commit is contained in:
@@ -22,12 +22,14 @@ const postQuerySubmit = async (req, res) => {
|
||||
|
||||
const emailInput = req.body.email;
|
||||
const emailConfirmInput = req.body.confirm;
|
||||
const title = "Upišite vaš e-mail";
|
||||
let error = "Greška ! Unesite validan email";
|
||||
|
||||
if (emailInput !== emailConfirmInput) {
|
||||
error = "Greška ! Unešeni emailovi nisu isti";
|
||||
res.render("querySubmit", {
|
||||
error
|
||||
error,
|
||||
title
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -35,7 +37,8 @@ const postQuerySubmit = async (req, res) => {
|
||||
if (!isValidEmail(emailInput)) {
|
||||
error = "Greška ! Unesite validan email";
|
||||
res.render("querySubmit", {
|
||||
error
|
||||
error,
|
||||
title
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user