From 17db6077b643afa7d463ad971c9e8f4a47d207ef Mon Sep 17 00:00:00 2001 From: Bo Andersen Date: Mon, 27 Nov 2017 19:08:19 +0100 Subject: [PATCH 1/2] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 +``` From 0a05ae9a9bb13e8f73721ba0148db7abe29c4d8a Mon Sep 17 00:00:00 2001 From: Bo Andersen Date: Fri, 15 Dec 2017 12:27:33 +0100 Subject: [PATCH 2/2] Fixed delete review bug --- .gitignore | 3 ++- backend/server.js | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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/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; } }