refactor redirect - use new method to find real estate by id

This commit is contained in:
Bilal Catic
2019-09-30 10:31:07 +02:00
parent 31ffc3253f
commit af36653c1a

View File

@@ -1,8 +1,8 @@
const { getMarketAlertById } = require("../helpers/db/dbHelper");
const { getRealEstateById } = require("../helpers/db/realEstate");
const redirect = async (req, res) => {
const id = req.params["id"];
const marketAlert = await getMarketAlertById(id);
const marketAlert = await getRealEstateById(id);
if (marketAlert) {
res.redirect(marketAlert.url);
} else {