update issue link index
This commit is contained in:
parent
0fda6721de
commit
dddc4f9752
|
@ -21,20 +21,13 @@ class Api::Pm::IssuesController < Api::Pm::BaseController
|
|||
|
||||
def link_index
|
||||
pm_issue_type = params[:pm_issue_type] || [1, 2, 3]
|
||||
not_join_id = @issue.pm_links.pluck(:be_linkable_id)
|
||||
not_join_id << @issue.id
|
||||
object_issues = Issue.includes(:pm_links).where(
|
||||
pm_project_id: params[:pm_project_id],
|
||||
root_id: nil,
|
||||
pm_issue_type: pm_issue_type
|
||||
).where.not(id: not_join_id)
|
||||
@issues = kaminari_paginate(object_issues)
|
||||
render 'api/v1/issues/index'
|
||||
end
|
||||
not_join_id = case params[:issue_filter_type]
|
||||
when 'leaf_issue'
|
||||
@issue.pm_links.pluck(:be_linkable_id)
|
||||
when 'link_issue'
|
||||
Issue.where(root_id: @issue.id).pluck(:id)
|
||||
end
|
||||
|
||||
def link_issues
|
||||
pm_issue_type = params[:pm_issue_type] || [1, 2, 3]
|
||||
not_join_id = Issue.where(root_id: @issue.id).pluck(:id)
|
||||
not_join_id << @issue.id
|
||||
object_issues = Issue.where(
|
||||
pm_project_id: params[:pm_project_id],
|
||||
|
@ -45,7 +38,6 @@ class Api::Pm::IssuesController < Api::Pm::BaseController
|
|||
render 'api/v1/issues/index'
|
||||
end
|
||||
|
||||
|
||||
def show
|
||||
@issue.associate_attachment_container
|
||||
render 'api/v1/issues/show'
|
||||
|
|
|
@ -11,7 +11,6 @@ defaults format: :json do
|
|||
end
|
||||
member do
|
||||
get :link_index
|
||||
get :link_issues
|
||||
end
|
||||
|
||||
resources :issue_links
|
||||
|
|
Loading…
Reference in New Issue