Assume email when creating notifications

This commit is contained in:
=
2019-03-08 07:33:19 -08:00
parent 8a1e406f43
commit 1f7063f94e
2 changed files with 27 additions and 42 deletions

View File

@@ -49,16 +49,17 @@ app.get("/items/:url", async (req, res) => {
app.post("/marketalerts", function(req, res) {
const { email, last_date, olx_url } = req.body;
console.log(email, last_date, olx_url);
//res.json({ message: "Market Alert Created!" });
sequelize.sync().then(() =>
MarketAlert.create({
olx_url,
last_date,
email
})
res.json({ message: "Market Alert Created!" });
);
//res.json({ message: "Market Alert Created!" });
sequelize.sync().then(() => {
MarketAlert.create({
olx_url,
last_date,
email
})
.then(() => {
res.json({ message: "Market Alert Created!" });
})
.catch(e => console.error(e));
});
});
app.post("/payforalert", function(request, response) {