Skip to content

Commit

Permalink
Petition, Update
Browse files Browse the repository at this point in the history
  • Loading branch information
LinaLtu committed Feb 28, 2018
1 parent 099f9a5 commit dd8f5e2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 13 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,21 @@ app.post("/profile/edit", csrfProtection, (req, res) => {
console.log("Does exist ", doesExist);
if (!doesExist) {
// console.log("Row does not exist");
insertIntoProfileInfoUsers(userId, age, city, url);
res.redirect("/");
if (isNaN(age)) {
res.redirect("/profile/edit");
} else {
insertIntoProfileInfoUsers(userId, age, city, url);
res.redirect("/");
}
} else {
console.log("Req.body inside of checkUserInfo ", req.body);
updateProfileInfoUsers(age, city, url, userId);
console.log("Data inserted: ", age, city, url, userId);
res.redirect("/");
if (isNaN(age)) {
res.redirect("/profile/edit");
} else {
updateProfileInfoUsers(age, city, url, userId);
console.log("Data inserted: ", age, city, url, userId);
res.redirect("/");
}
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion views/thankyou.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="picture-thanks">
<img src="/pizza.jpg" id="ananas">
</div>
<h2>Thank you for signing our petition to outlaw putting pineapple on the pizza</h2>
<h2>Thank you for signing our petition to outlaw putting pineapple on pizza</h2>
<div class="picture-thanks-sign">
<img src='{{signature}}'>
</div>
Expand Down

0 comments on commit dd8f5e2

Please sign in to comment.