issue index to name
This commit is contained in:
parent
69f8b43186
commit
3d0cd96e32
|
@ -1,12 +1,12 @@
|
|||
class IssuesController < ApplicationController
|
||||
before_action :require_login, except: [:index, :show, :index_chosen]
|
||||
before_action :require_login, except: [:index, :show, :index_chosen, :index_to_name]
|
||||
before_action :require_profile_completed, only: [:create]
|
||||
before_action :load_project
|
||||
before_action :set_user
|
||||
before_action :check_menu_authorize, except: [:index_chosen]
|
||||
before_action :check_issue_permission
|
||||
before_action :operate_issue_permission, only:[:create, :update, :destroy, :clean, :series_update, :copy]
|
||||
before_action :check_project_public, only: [:index ,:show, :copy, :index_chosen, :close_issue]
|
||||
before_action :check_project_public, only: [:index ,:show, :copy, :index_chosen, :close_issue, :index_to_name]
|
||||
|
||||
before_action :set_issue, only: [:edit, :update, :destroy, :show, :copy, :close_issue, :lock_issue]
|
||||
before_action :check_token_enough, :find_atme_receivers, only: [:create, :update]
|
||||
|
@ -49,6 +49,11 @@ class IssuesController < ApplicationController
|
|||
@issue_chosen = issue_left_chosen(@project, nil)
|
||||
end
|
||||
|
||||
def index_to_name
|
||||
issues_result = @project.issues.where(project_issues_index:params[:index]).map{|e|{project_issues_index:e.project_issues_index,subject:e.subject}}
|
||||
render json: issues_result
|
||||
end
|
||||
|
||||
def commit_issues
|
||||
issues = @project.issues.issue_issue.includes(:user,:tracker)
|
||||
issues = issues.where(is_private: false) unless current_user.present? && (current_user.admin? || @project.member?(current_user))
|
||||
|
|
|
@ -574,6 +574,7 @@ Rails.application.routes.draw do
|
|||
get :index_chosen
|
||||
post :clean
|
||||
post :series_update
|
||||
get :index_to_name
|
||||
end
|
||||
member do
|
||||
post :copy
|
||||
|
|
Loading…
Reference in New Issue