Merge branch 'remove-payment-step' into 'master'

Remove payment step

See merge request saburly/marketalarm/web!1
This commit was merged in pull request #1.
This commit is contained in:
Edin
2019-03-06 19:32:34 +00:00
2 changed files with 17 additions and 67 deletions

View File

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

View File

@@ -62,7 +62,7 @@ class NotificationModal extends React.Component {
}; };
successCallback = data => { successCallback = data => {
token = data.response.token.token; //token = data.response.token.token;
const { const {
userdata: { email, last_date, olx_url } userdata: { email, last_date, olx_url }
} = this.props; } = this.props;
@@ -73,18 +73,10 @@ class NotificationModal extends React.Component {
last_date, last_date,
olx_url olx_url
}) })
.then(response => .then(response => {
axios this.handleClose();
.post("/payforalert", { alert("Market Alert Created");
email, })
token
})
.then(response => {
this.handleClose();
alert("Market Alert Created");
})
.catch(error => console.log(error))
)
.catch(error => console.log(error)); .catch(error => console.log(error));
}; };
@@ -114,7 +106,8 @@ class NotificationModal extends React.Component {
}; };
handleSaveMarketAlert = () => { handleSaveMarketAlert = () => {
this.tokenRequest(); this.successCallback();
//this.tokenRequest();
}; };
render() { render() {
@@ -191,50 +184,6 @@ class NotificationModal extends React.Component {
type="hidden" type="hidden"
value={token} value={token}
/> />
<Input
className={classes.inputStyle}
placeholder="Card Number"
inputProps={{
"aria-label": "Card Number"
}}
required
autoComplete="off"
type="number"
onChange={e => this.handleInput(e, "ccNo")}
/>
<Input
className={classes.inputStyle}
placeholder="Expiration Year"
inputProps={{
"aria-label": "Expiration Year"
}}
required
autoComplete="off"
type="number"
onChange={e => this.handleInput(e, "expYear")}
/>
<Input
className={classes.inputStyle}
placeholder="Expiration Month"
inputProps={{
"aria-label": "Expiration Month"
}}
required
autoComplete="off"
type="number"
onChange={e => this.handleInput(e, "expMonth")}
/>
<Input
className={classes.inputStyle}
placeholder="CVV"
inputProps={{
"aria-label": "CVV"
}}
required
autoComplete="off"
type="number"
onChange={e => this.handleInput(e, "cvv")}
/>
</div> </div>
) : null} ) : null}
</DialogContent> </DialogContent>