FIX: Performing actions on a particular reviewable was displaying an error

pending
#1

FIX: Performing actions on a particular reviewable was displaying an error

It was expecting a method to remove the reviewable from the current list, only we were not displaying a list.

Instead, we refresh the reviewable model with the latest result.

diff --git a/app/assets/javascripts/discourse/components/reviewable-item.js.es6 b/app/assets/javascripts/discourse/components/reviewable-item.js.es6
index 3a84d0a..d94128f 100644
--- a/app/assets/javascripts/discourse/components/reviewable-item.js.es6
+++ b/app/assets/javascripts/discourse/components/reviewable-item.js.es6
@@ -92,7 +92,11 @@ export default Ember.Component.extend({
             this.currentUser.set("reviewable_count", result.reviewable_count);
           }
 
-          this.attrs.remove(performResult.remove_reviewable_ids);
+          if (this.attrs.remove) {
+            this.attrs.remove(performResult.remove_reviewable_ids);
+          } else {
+            return this.store.find("reviewable", reviewable.id);
+          }
         })
         .catch(popupAjaxError)
         .finally(() => this.set("updating", false));

GitHub sha: 13b979cb

1 Like