Skip to content

Commit

Permalink
third commit
Browse files Browse the repository at this point in the history
  • Loading branch information
harbansi committed Aug 14, 2020
1 parent bf7a6e0 commit 944b98c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 0 additions & 2 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ router.get('/', function (req, res) {

// for add to cart
router.get("/add-to-cart/:id", function (req, res) {
console.log(req.session.current_url);

const productId = req.params.id;
const cart = new Cart(req.session.cart ? req.session.cart : { items: {} });
var fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl;

Product.findById(productId, function (err, product) {
if (err) {
Expand Down
5 changes: 3 additions & 2 deletions routes/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ router.post('/register', (req, res) => {
name,
email,
password,
password2
password2,
title:"register page"
});
} else {
User.findOne({ email: email }).then(user => {
Expand All @@ -59,7 +60,7 @@ router.post('/register', (req, res) => {
name,
email,
password,
password2
password2,title:"register page"
});
} else {
const newUser = new User({
Expand Down
4 changes: 4 additions & 0 deletions views/register.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
class="form-control"
placeholder="Enter Name"
value="<%= typeof name != 'undefined' ? name : '' %>" autofocus
required
/>

<label for="email" class="sr-only">Email address</label>
Expand All @@ -28,6 +29,7 @@
class="form-control"
placeholder="Enter Email"
value="<%= typeof email != 'undefined' ? email : '' %>"
required
/>
<label for="password" class="sr-only">Password</label>

Expand All @@ -38,6 +40,7 @@
class="form-control"
placeholder="Create Password"
value="<%= typeof password != 'undefined' ? password : '' %>"
required
/>
<label for="password2"class="sr-only"></label>
<input
Expand All @@ -47,6 +50,7 @@
class="form-control"
placeholder="Confirm Password"
value="<%= typeof password2 != 'undefined' ? password2 : '' %>"
required
/>
<button type="submit" class="btn btn-block user-button">
Register
Expand Down

0 comments on commit 944b98c

Please sign in to comment.