Email links now point to our URL and then redirect to the original property URL, ran prettier on the affected files
This commit is contained in:
16
app/controllers/redirect.js
Normal file
16
app/controllers/redirect.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const { getMarketAlertById } = require("../helpers/db/dbHelper");
|
||||
|
||||
const redirect = async (req, res) => {
|
||||
const id = req.params["id"];
|
||||
const marketAlert = await getMarketAlertById(id);
|
||||
if (marketAlert) {
|
||||
res.redirect(marketAlert.url);
|
||||
} else {
|
||||
res.send("Not found");
|
||||
res.end();
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
redirect
|
||||
};
|
||||
Reference in New Issue
Block a user