diff --git a/.gitignore b/.gitignore index 6d84185..433666c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store .idea -node_modules \ No newline at end of file +node_modules +dist/ \ No newline at end of file diff --git a/README.md b/README.md index 92c826b..bce1074 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Working with HTTP in Vue.js -This repository contains the code for the HTTP section from the [Vue.js: From Beginner to Professional course](https://codingexplained.com/l/github/vue-js-github). +This repository contains the code for the HTTP section from the [Vue.js: From Beginner to Professional course](https://l.codingexplained.com/course/vuejs?src=github). ## Getting up and Running @@ -13,4 +13,4 @@ npm run dev # Build for production with minification npm run build -``` \ No newline at end of file +``` diff --git a/backend/server.js b/backend/server.js index d534285..60d089c 100644 --- a/backend/server.js +++ b/backend/server.js @@ -20,17 +20,16 @@ function deleteReview(productId, reviewId) { let product = getProduct(productId); if (product) { - let reviews = product.reviews; let index = -1; - for (let i = 0; i < reviews.length && index == -1; i++) { - if (reviews[i].id == reviewId) { + for (let i = 0; i < product.reviews.length && index == -1; i++) { + if (product.reviews[i].id == reviewId) { index = i; } } if (index != -1) { - product.reviews = reviews.splice(index, 1); + product.reviews.splice(index, 1); return true; } }