refactor redirect - use new method to find real estate by id
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
const { getMarketAlertById } = require("../helpers/db/dbHelper");
|
const { getRealEstateById } = require("../helpers/db/realEstate");
|
||||||
|
|
||||||
const redirect = async (req, res) => {
|
const redirect = async (req, res) => {
|
||||||
const id = req.params["id"];
|
const id = req.params["id"];
|
||||||
const marketAlert = await getMarketAlertById(id);
|
const marketAlert = await getRealEstateById(id);
|
||||||
if (marketAlert) {
|
if (marketAlert) {
|
||||||
res.redirect(marketAlert.url);
|
res.redirect(marketAlert.url);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user