update issue link index

This commit is contained in:
呱呱呱 2023-11-15 14:18:36 +08:00
parent 0fda6721de
commit dddc4f9752
2 changed files with 6 additions and 15 deletions

View File

@ -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'
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'

View File

@ -11,7 +11,6 @@ defaults format: :json do
end
member do
get :link_index
get :link_issues
end
resources :issue_links