diff --git a/backend/index.js b/backend/index.js index bbe3317..2eb16da 100644 --- a/backend/index.js +++ b/backend/index.js @@ -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) { diff --git a/frontend-react/src/components/NotificationModal.js b/frontend-react/src/components/NotificationModal.js index 395741b..52ac829 100644 --- a/frontend-react/src/components/NotificationModal.js +++ b/frontend-react/src/components/NotificationModal.js @@ -154,38 +154,22 @@ class NotificationModal extends React.Component { id="classic-modal-slide-description" className={classes.modalBody} > - this.optionChange("emailChecked")} - /> - } - label={Email} - /> - - {this.isChecked("emailChecked") ? ( -
- - -
- ) : null} +
+ + +
{validEmail ? (