Compare commits
7 Commits
migrate-to
...
heroku-por
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fc24add1f | ||
|
|
b1a08a7a57 | ||
|
|
1f7063f94e | ||
|
|
8a1e406f43 | ||
|
|
01b864d75b | ||
|
|
b7cb61b53b | ||
|
|
a957293029 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules/
|
||||
@@ -49,15 +49,17 @@ 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!" });
|
||||
sequelize.sync().then(() => {
|
||||
MarketAlert.create({
|
||||
olx_url,
|
||||
last_date,
|
||||
email
|
||||
})
|
||||
.then(() => {
|
||||
res.json({ message: "Market Alert Created!" });
|
||||
})
|
||||
.catch(e => console.error(e));
|
||||
});
|
||||
});
|
||||
|
||||
app.post("/payforalert", function(request, response) {
|
||||
@@ -93,4 +95,10 @@ app.post("/payforalert", function(request, response) {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// Anything that doesn't match the above, send back index.html
|
||||
app.get('*', (req, res) => {
|
||||
res.sendFile(path.join(__dirname + '/../frontend-react/build/index.html'))
|
||||
})
|
||||
|
||||
app.listen(port, () => console.log(`Example app listening on port ${port}!`));
|
||||
|
||||
@@ -20,6 +20,10 @@ const appStyle = theme => ({
|
||||
zIndex: "1",
|
||||
backgroundColor: "#272727",
|
||||
backgroundImage: "linear-gradient(180deg,#272727, #21525f)"
|
||||
},
|
||||
itemsCountTitle: {
|
||||
textAlign: 'center',
|
||||
color: 'white'
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -84,9 +84,8 @@ class App extends React.Component {
|
||||
return (
|
||||
<div className={classes.wrapper}>
|
||||
<Sidebar logoText={"Market Alarm"} logo={logo} image={image} />
|
||||
|
||||
<div className={classes.mainPanel}>
|
||||
<ItemsContainer />
|
||||
{items.length && <h3 className={classes.itemsCountTitle}>Pronađeno {items.length} nekretnina. Napravite notifikaciju i primite vise detalja na vas emailu adresu.</h3>}
|
||||
{items.length ? <NotificationModal /> : null}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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() {
|
||||
@@ -161,82 +154,22 @@ class NotificationModal extends React.Component {
|
||||
id="classic-modal-slide-description"
|
||||
className={classes.modalBody}
|
||||
>
|
||||
<FormControlLabel
|
||||
className={classes.whiteText}
|
||||
control={
|
||||
<Checkbox
|
||||
className={classes.checkBoxStyle}
|
||||
checked={this.isChecked("emailChecked")}
|
||||
type={"checkbox"}
|
||||
value={""}
|
||||
onChange={() => this.optionChange("emailChecked")}
|
||||
/>
|
||||
}
|
||||
label={<Typography style={{ color: "white" }}>Email</Typography>}
|
||||
/>
|
||||
|
||||
{this.isChecked("emailChecked") ? (
|
||||
<div>
|
||||
<Input
|
||||
className={classes.inputStyle}
|
||||
placeholder="Email"
|
||||
inputProps={{
|
||||
"aria-label": "Email"
|
||||
}}
|
||||
type="email"
|
||||
onChange={this.handleEmail}
|
||||
/>
|
||||
<Input
|
||||
className={classes.inputStyle}
|
||||
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}
|
||||
<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>
|
||||
</DialogContent>
|
||||
<DialogActions className={classes.modalFooter}>
|
||||
{validEmail ? (
|
||||
|
||||
1153
package-lock.json
generated
1153
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
25
package.json
Normal file
25
package.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "marketalarm",
|
||||
"version": "1.0.0",
|
||||
"description": "Market Alarm",
|
||||
"main": "./backend/index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@gitlab.com:saburly/marketalarm/web.git"
|
||||
},
|
||||
"author": "Saburlije",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": "11.10.x"
|
||||
},
|
||||
"dependencies": {
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "node ./backend/index.js",
|
||||
"heroku-postbuild": "cd frontend-react && npm install && npm run build && cd .. && cd backend && npm install"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user