diff --git a/app/controllers/redirect.js b/app/controllers/redirect.js
index 49ea271..9975ab2 100644
--- a/app/controllers/redirect.js
+++ b/app/controllers/redirect.js
@@ -1,16 +1,5 @@
const { getRealEstateById } = require("../helpers/db/realEstate");
-const redirect = async (req, res) => {
- const id = req.params["id"];
- const marketAlert = await getRealEstateById(id);
- if (marketAlert) {
- res.redirect(marketAlert.url);
- } else {
- res.send("Not found");
- res.end();
- }
-};
-
const getRedirect = async (req, res) => {
const id = req.params.id || null;
let error = false;
@@ -18,11 +7,15 @@ const getRedirect = async (req, res) => {
if (!id) {
error = true;
} else {
- const realEstate = await getRealEstateById(id);
- if (!realEstate) {
+ try {
+ const realEstate = await getRealEstateById(id);
+ if (!realEstate) {
+ error = true;
+ } else {
+ redirectUrl = realEstate.url;
+ }
+ } catch (e) {
error = true;
- } else {
- redirectUrl = realEstate.url;
}
}
diff --git a/app/controllers/unsubscribe.js b/app/controllers/unsubscribe.js
index a6c400f..95b39b2 100644
--- a/app/controllers/unsubscribe.js
+++ b/app/controllers/unsubscribe.js
@@ -3,6 +3,12 @@ const { currentSearchRequest } = require("../helpers/url");
const getUnsubscribe = async (req, res) => {
const title = "Uspješno ste se odjavili";
const searchRequest = await currentSearchRequest(req);
+
+ if (!searchRequest || !searchRequest.dataValues) {
+ res.render("notFound", { title: " " });
+ return;
+ }
+
searchRequest.subscribed = false;
await searchRequest.save();
diff --git a/app/public/images/logo.png b/app/public/images/logo.png
deleted file mode 100644
index 21033de..0000000
Binary files a/app/public/images/logo.png and /dev/null differ
diff --git a/app/public/images/logo.svg b/app/public/images/logo.svg
new file mode 100644
index 0000000..77b1282
--- /dev/null
+++ b/app/public/images/logo.svg
@@ -0,0 +1,79 @@
+
+
diff --git a/app/public/main.css b/app/public/main.css
index aa7d733..e43255f 100644
--- a/app/public/main.css
+++ b/app/public/main.css
@@ -18,13 +18,6 @@
left: 25%;
}
-.welcome-big-logo {
- font-size: 200pt;
- background-image: url(./images/logo.png);
- background-size: contain;
- background-repeat: no-repeat;
- color: rgba(0, 0, 0, 0);
-}
.no-ui-slider {
width: 95%;
}
diff --git a/app/views/realEstateType.ejs b/app/views/realEstateType.ejs
index 6e2b6ae..e1d9f7c 100644
--- a/app/views/realEstateType.ejs
+++ b/app/views/realEstateType.ejs
@@ -4,8 +4,9 @@
<% for(const realEstateType of realEstateTypes) { %>
<%= realEstateType.title %>
diff --git a/app/views/unsubscribe.ejs b/app/views/unsubscribe.ejs
index d11301e..44dab4d 100644
--- a/app/views/unsubscribe.ejs
+++ b/app/views/unsubscribe.ejs
@@ -1,10 +1,12 @@
+
+