From dd9b26138aed0285632494f8a68734441f12dccd Mon Sep 17 00:00:00 2001
From: Lukas Schneider <lukas.s.schneider@fau.de>
Date: Fri, 20 Sep 2019 11:43:18 +0200
Subject: [PATCH] Replace filter with forEach in buy and charge template

---
 store/templates/buy.html    | 3 +--
 store/templates/charge.html | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/store/templates/buy.html b/store/templates/buy.html
index 852f647..c56ca61 100644
--- a/store/templates/buy.html
+++ b/store/templates/buy.html
@@ -194,12 +194,11 @@
                     },
                     success: data => {
                         clearError();
-                        recently_bought.filter(item => {
+                        recently_bought.forEach(item => {
                             if (item.purchase_id == id) {
                                 item.annullated = true;
                                 increaseMoney(item.price);
                             }
-                            return true;
                         });
                         updateRecentlyBoughtList();
                     },
diff --git a/store/templates/charge.html b/store/templates/charge.html
index 98cd410..e7c0e11 100644
--- a/store/templates/charge.html
+++ b/store/templates/charge.html
@@ -179,12 +179,11 @@
                     },
                     success: data => {
                         clearError();
-                        recent_charges.filter(item => {
+                        recent_charges.forEach(item => {
                             if (item.id == id) {
                                 item.annullated = true;
                                 reduceMoney(item.amount);
                             }
-                            return true;
                         });
                         updateRecentCharges();
                     },
-- 
GitLab