Assume email when creating notifications
This commit is contained in:
@@ -49,16 +49,17 @@ 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!" });
|
sequelize.sync().then(() => {
|
||||||
sequelize.sync().then(() =>
|
MarketAlert.create({
|
||||||
MarketAlert.create({
|
olx_url,
|
||||||
olx_url,
|
last_date,
|
||||||
last_date,
|
email
|
||||||
email
|
})
|
||||||
})
|
.then(() => {
|
||||||
res.json({ message: "Market Alert Created!" });
|
res.json({ message: "Market Alert Created!" });
|
||||||
);
|
})
|
||||||
//res.json({ message: "Market Alert Created!" });
|
.catch(e => console.error(e));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
app.post("/payforalert", function(request, response) {
|
app.post("/payforalert", function(request, response) {
|
||||||
|
|||||||
@@ -154,38 +154,22 @@ class NotificationModal extends React.Component {
|
|||||||
id="classic-modal-slide-description"
|
id="classic-modal-slide-description"
|
||||||
className={classes.modalBody}
|
className={classes.modalBody}
|
||||||
>
|
>
|
||||||
<FormControlLabel
|
<div>
|
||||||
className={classes.whiteText}
|
<Input
|
||||||
control={
|
className={classes.inputStyle}
|
||||||
<Checkbox
|
placeholder="Email"
|
||||||
className={classes.checkBoxStyle}
|
inputProps={{
|
||||||
checked={this.isChecked("emailChecked")}
|
"aria-label": "Email"
|
||||||
type={"checkbox"}
|
}}
|
||||||
value={""}
|
type="email"
|
||||||
onChange={() => this.optionChange("emailChecked")}
|
onChange={this.handleEmail}
|
||||||
/>
|
/>
|
||||||
}
|
<Input
|
||||||
label={<Typography style={{ color: "white" }}>Email</Typography>}
|
className={classes.inputStyle}
|
||||||
/>
|
type="hidden"
|
||||||
|
value={token}
|
||||||
{this.isChecked("emailChecked") ? (
|
/>
|
||||||
<div>
|
</div>
|
||||||
<Input
|
|
||||||
className={classes.inputStyle}
|
|
||||||
placeholder="Email"
|
|
||||||
inputProps={{
|
|
||||||
"aria-label": "Email"
|
|
||||||
}}
|
|
||||||
type="email"
|
|
||||||
onChange={this.handleEmail}
|
|
||||||
/>
|
|
||||||
<Input
|
|
||||||
className={classes.inputStyle}
|
|
||||||
type="hidden"
|
|
||||||
value={token}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions className={classes.modalFooter}>
|
<DialogActions className={classes.modalFooter}>
|
||||||
{validEmail ? (
|
{validEmail ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user