diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2018-03-02 01:09:25 +0300 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2018-03-07 01:32:26 +0300 |
commit | a16547e5c2d42bfe7af025556e90f0f895a97f59 (patch) | |
tree | 093a4c25545f78454fda80c681570e264aab143b /app/controllers/projects/labels_controller.rb | |
parent | f42397d19a735de2e5ae38725270614826ec05da (diff) |
used respond_to formats for persisting flash messages instead
Diffstat (limited to 'app/controllers/projects/labels_controller.rb')
-rw-r--r-- | app/controllers/projects/labels_controller.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/controllers/projects/labels_controller.rb b/app/controllers/projects/labels_controller.rb index a9fc890b28c..99790b8e7e8 100644 --- a/app/controllers/projects/labels_controller.rb +++ b/app/controllers/projects/labels_controller.rb @@ -1,6 +1,5 @@ class Projects::LabelsController < Projects::ApplicationController include ToggleSubscriptionAction - include FlashHelper before_action :check_issuables_available! before_action :label, only: [:edit, :update, :destroy, :promote] @@ -113,11 +112,14 @@ class Projects::LabelsController < Projects::ApplicationController begin return render_404 unless promote_service.execute(@label) + flash[:notice] = "#{@label.title} promoted to group label." respond_to do |format| format.html do - redirect_to(project_labels_path(@project, body_data: get_body_data_page(project_labels_path(@project))), status: 303) + redirect_to(project_labels_path(@project), status: 303) + end + format.json do + render json: { url: project_labels_path(@project) } end - format.js end rescue ActiveRecord::RecordInvalid => e Gitlab::AppLogger.error "Failed to promote label \"#{@label.title}\" to group label" |