Commit fa6593b2 authored by Alfredo Sumaran's avatar Alfredo Sumaran

Update method and route

parent f011f038
......@@ -5,7 +5,7 @@ class Projects::LabelsController < Projects::ApplicationController
before_action :label, only: [:edit, :update, :destroy]
before_action :authorize_read_label!
before_action :authorize_admin_labels!, only: [
:new, :create, :edit, :update, :generate, :destroy
:new, :create, :edit, :update, :generate, :destroy, :remove_priority
]
respond_to :js, :html
......@@ -83,7 +83,7 @@ class Projects::LabelsController < Projects::ApplicationController
end
end
def set_sorting
def set_priorities
Label.transaction do
params[:label_ids].each_with_index do |label_id, index|
label = @project.labels.find_by_id(label_id)
......
......@@ -719,7 +719,7 @@ Rails.application.routes.draw do
resources :labels, constraints: { id: /\d+/ } do
collection do
post :generate
post :set_sorting
post :set_priorities
end
member do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment