From 502c7c3e35a428345f655b6aa4747c7b15021afd Mon Sep 17 00:00:00 2001 From: Bilal Catic Date: Mon, 30 Sep 2019 19:33:01 +0200 Subject: [PATCH] fix error on email validation failure --- app/controllers/querySubmit.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/querySubmit.js b/app/controllers/querySubmit.js index ecdeca1..6d623f1 100644 --- a/app/controllers/querySubmit.js +++ b/app/controllers/querySubmit.js @@ -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; }