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) {
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) {

View File

@@ -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));
};
@@ -114,7 +106,8 @@ class NotificationModal extends React.Component {
};
handleSaveMarketAlert = () => {
this.tokenRequest();
this.successCallback();
//this.tokenRequest();
};
render() {
@@ -191,50 +184,6 @@ class NotificationModal extends React.Component {
type="hidden"
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>
) : null}
</DialogContent>