Fix lodash removal error (#38)

Fix lodash removal error (#38)

  • FIX - iterate over objects in the correct way

  • DEV - use previous var name for consistency

diff --git a/assets/javascripts/discourse/controllers/admin-plugins-patreon.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-patreon.js.es6
index 9171e22..7df0324 100644
--- a/assets/javascripts/discourse/controllers/admin-plugins-patreon.js.es6
+++ b/assets/javascripts/discourse/controllers/admin-plugins-patreon.js.es6
@@ -12,7 +12,7 @@ export default Ember.Controller.extend({
 
   @computed("rewards")
   rewardsNames() {
-    return this.rewards
+    return Object.values(this.rewards)
       .filter((r) => r.id >= 0)
       .map((r) => this.prettyPrintReward(r));
   },
@@ -30,7 +30,7 @@ export default Ember.Controller.extend({
       );
       rule.set(
         "rewards_ids",
-        this.rewards
+        Object.values(this.rewards)
           .filter((v) =>
             rule.get("reward_list").includes(this.prettyPrintReward(v))
           )
diff --git a/assets/javascripts/discourse/routes/admin-plugins-patreon.js.es6 b/assets/javascripts/discourse/routes/admin-plugins-patreon.js.es6
index fb2ea77..6e276c7 100644
--- a/assets/javascripts/discourse/routes/admin-plugins-patreon.js.es6
+++ b/assets/javascripts/discourse/routes/admin-plugins-patreon.js.es6
@@ -29,7 +29,7 @@ export default DiscourseRoute.extend({
   setupController: function (controller, model) {
     const rewards = model.rewards;
     const groups = model.groups;
-    const filtersArray = model.filters.map((v, k) => {
+    const filtersArray = Object.entries(model.filters).map(([k, v]) => {
       const rewardsNames = v.map((r) =>
         rewards[r]
           ? ` $${rewards[r].amount_cents / 100} - ${rewards[r].title}`

GitHub sha: a6e88e55

This commit appears in #38 which was approved by eviltrout. It was merged by jbrw.