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 emailInput = req.body.email;
|
||||||
const emailConfirmInput = req.body.confirm;
|
const emailConfirmInput = req.body.confirm;
|
||||||
|
const title = "Upišite vaš e-mail";
|
||||||
let error = "Greška ! Unesite validan email";
|
let error = "Greška ! Unesite validan email";
|
||||||
|
|
||||||
if (emailInput !== emailConfirmInput) {
|
if (emailInput !== emailConfirmInput) {
|
||||||
error = "Greška ! Unešeni emailovi nisu isti";
|
error = "Greška ! Unešeni emailovi nisu isti";
|
||||||
res.render("querySubmit", {
|
res.render("querySubmit", {
|
||||||
error
|
error,
|
||||||
|
title
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -35,7 +37,8 @@ const postQuerySubmit = async (req, res) => {
|
|||||||
if (!isValidEmail(emailInput)) {
|
if (!isValidEmail(emailInput)) {
|
||||||
error = "Greška ! Unesite validan email";
|
error = "Greška ! Unesite validan email";
|
||||||
res.render("querySubmit", {
|
res.render("querySubmit", {
|
||||||
error
|
error,
|
||||||
|
title
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user