Skip to content

Commit 4adbb6d

Browse files
author
Rachel Macfarlane
committed
Remove unused variables
1 parent b16c1ea commit 4adbb6d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

routes/index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ var fs = require('fs');
66
var Cart = require('../models/cart');
77
var products = JSON.parse(fs.readFileSync('./data/products.json', 'utf8'));
88

9-
router.get('/', function (req, res, next) {
10-
var productId = products && products[0].id;
11-
9+
router.get('/', function (_req, res, _next) {
1210
res.render('index',
1311
{
1412
title: 'NodeJS Shopping Cart',
@@ -17,7 +15,7 @@ router.get('/', function (req, res, next) {
1715
);
1816
});
1917

20-
router.get('/add/:id', function(req, res, next) {
18+
router.get('/add/:id', function(req, res, _next) {
2119

2220
var productId = req.params.id;
2321
var cart = new Cart(req.session.cart ? req.session.cart : {});
@@ -30,7 +28,7 @@ router.get('/add/:id', function(req, res, next) {
3028
inline();
3129
});
3230

33-
router.get('/cart', function(req, res, next) {
31+
router.get('/cart', function(req, res, _next) {
3432
if (!req.session.cart) {
3533
return res.render('cart', {
3634
products: null
@@ -44,7 +42,7 @@ router.get('/cart', function(req, res, next) {
4442
});
4543
});
4644

47-
router.get('/remove/:id', function(req, res, next) {
45+
router.get('/remove/:id', function(req, res, _next) {
4846
var productId = req.params.id;
4947
var cart = new Cart(req.session.cart ? req.session.cart : {});
5048

0 commit comments

Comments
 (0)