summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/labels_controller.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/projects/labels_controller.rb b/app/controllers/projects/labels_controller.rb
index ecac3c395ec..d0334c37b67 100644
--- a/app/controllers/projects/labels_controller.rb
+++ b/app/controllers/projects/labels_controller.rb
@@ -1,8 +1,8 @@
class Projects::LabelsController < Projects::ApplicationController
before_action :module_enabled
- before_action :label, only: [:edit, :update, :destroy]
+ before_action :label, only: [:edit, :update, :destroy, :toggle_subscription]
before_action :authorize_read_label!
- before_action :authorize_admin_labels!, except: [:index]
+ before_action :authorize_admin_labels!, except: [:index, :toggle_subscription]
respond_to :js, :html
@@ -60,6 +60,11 @@ class Projects::LabelsController < Projects::ApplicationController
end
end
+ def toggle_subscription
+ @label.toggle_subscription(current_user)
+ render nothing: true
+ end
+
protected
def module_enabled