Don't contact TCO api
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
@@ -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));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user