redirect to Not Found page when search request param is missing from URL

This commit is contained in:
Bilal Catic
2019-10-15 18:51:19 +02:00
parent 566f9c4345
commit acdeca94df
2 changed files with 16 additions and 0 deletions

View File

@@ -13,6 +13,11 @@ const getLocation = async (req, res) => {
const postLocation = async (req, res) => {
let searchRequest = await currentSearchRequest(req);
if (!searchRequest || !searchRequest.dataValues) {
res.render("notFound", { title: " " });
return;
}
const northWest = [req.body.west, req.body.north];
const northEast = [req.body.east, req.body.north];
const southEast = [req.body.east, req.body.south];