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) {
|
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!" });
|
})
|
||||||
|
.catch(e => console.error(e));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
app.post("/payforalert", function(request, response) {
|
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}!`));
|
app.listen(port, () => console.log(`Example app listening on port ${port}!`));
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ const appStyle = theme => ({
|
|||||||
zIndex: "1",
|
zIndex: "1",
|
||||||
backgroundColor: "#272727",
|
backgroundColor: "#272727",
|
||||||
backgroundImage: "linear-gradient(180deg,#272727, #21525f)"
|
backgroundImage: "linear-gradient(180deg,#272727, #21525f)"
|
||||||
|
},
|
||||||
|
itemsCountTitle: {
|
||||||
|
textAlign: 'center',
|
||||||
|
color: 'white'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -84,9 +84,8 @@ class App extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div className={classes.wrapper}>
|
<div className={classes.wrapper}>
|
||||||
<Sidebar logoText={"Market Alarm"} logo={logo} image={image} />
|
<Sidebar logoText={"Market Alarm"} logo={logo} image={image} />
|
||||||
|
|
||||||
<div className={classes.mainPanel}>
|
<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}
|
{items.length ? <NotificationModal /> : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -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() {
|
||||||
@@ -161,82 +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}
|
|
||||||
/>
|
|
||||||
<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>
|
</DialogContent>
|
||||||
<DialogActions className={classes.modalFooter}>
|
<DialogActions className={classes.modalFooter}>
|
||||||
{validEmail ? (
|
{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