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