From a957293029934fad54e83d1ca131d1a7ec1008b6 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 5 Mar 2019 09:31:04 -0800 Subject: [PATCH 1/2] Removed card info inputs Left to do: - Remove TCO integration calls - Actually save notification - Display a nice message --- .../src/components/NotificationModal.js | 47 +------------------ 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/frontend-react/src/components/NotificationModal.js b/frontend-react/src/components/NotificationModal.js index e829004..15d182e 100644 --- a/frontend-react/src/components/NotificationModal.js +++ b/frontend-react/src/components/NotificationModal.js @@ -114,7 +114,8 @@ class NotificationModal extends React.Component { }; handleSaveMarketAlert = () => { - this.tokenRequest(); + this.successCallback(); + //this.tokenRequest(); }; render() { @@ -191,50 +192,6 @@ class NotificationModal extends React.Component { type="hidden" value={token} /> - this.handleInput(e, "ccNo")} - /> - this.handleInput(e, "expYear")} - /> - this.handleInput(e, "expMonth")} - /> - this.handleInput(e, "cvv")} - /> ) : null} -- 2.47.3 From b7cb61b53be82d3f4fb30b30fb85cb5f5ed716ea Mon Sep 17 00:00:00 2001 From: = Date: Wed, 6 Mar 2019 11:31:10 -0800 Subject: [PATCH 2/2] Don't contact TCO api --- backend/index.js | 19 ++++++++++--------- .../src/components/NotificationModal.js | 18 +++++------------- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/backend/index.js b/backend/index.js index dfa36bc..bbe3317 100644 --- a/backend/index.js +++ b/backend/index.js @@ -49,15 +49,16 @@ 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 + }) + res.json({ message: "Market Alert Created!" }); + ); + //res.json({ message: "Market Alert Created!" }); }); app.post("/payforalert", function(request, response) { diff --git a/frontend-react/src/components/NotificationModal.js b/frontend-react/src/components/NotificationModal.js index 15d182e..395741b 100644 --- a/frontend-react/src/components/NotificationModal.js +++ b/frontend-react/src/components/NotificationModal.js @@ -62,7 +62,7 @@ class NotificationModal extends React.Component { }; successCallback = data => { - token = data.response.token.token; + //token = data.response.token.token; const { userdata: { email, last_date, olx_url } } = this.props; @@ -73,18 +73,10 @@ class NotificationModal extends React.Component { last_date, olx_url }) - .then(response => - axios - .post("/payforalert", { - email, - token - }) - .then(response => { - this.handleClose(); - alert("Market Alert Created"); - }) - .catch(error => console.log(error)) - ) + .then(response => { + this.handleClose(); + alert("Market Alert Created"); + }) .catch(error => console.log(error)); }; -- 2.47.3