调整 issues 的 root id 判定
This commit is contained in:
parent
a61996bdc3
commit
19458ac963
|
@ -72,9 +72,13 @@ class Api::V1::Issues::ListService < ApplicationService
|
|||
|
||||
#pm相关
|
||||
# root_id
|
||||
if root_id.present?
|
||||
issues = issues.where(root_id: root_id)
|
||||
end
|
||||
issues = if root_id.to_i == -1 ? # -1 查一级目录
|
||||
issues.where(root_id: nil)
|
||||
elsif root_id.to_i.positive?
|
||||
issues.where(root_id: root_id)
|
||||
else
|
||||
issues
|
||||
end
|
||||
|
||||
# pm_issue_type
|
||||
issues = issues.where(pm_issue_type: pm_issue_type) if pm_issue_type.present?
|
||||
|
|
|
@ -72,10 +72,13 @@ class Api::V1::Issues::UpdateService < ApplicationService
|
|||
@updated_issue.attachments = @attachments || Attachment.none unless attachment_ids.nil?
|
||||
@updated_issue.issue_tags_relates.destroy_all & @updated_issue.issue_tags = @issue_tags || IssueTag.none unless issue_tag_ids.nil?
|
||||
@updated_issue.issue_tags_value = @issue_tags.order("id asc").pluck(:id).join(",") unless issue_tag_ids.nil?
|
||||
|
||||
#Pm相关
|
||||
@updated_issue.pm_project_id = @target_pm_project_id unless @target_pm_project_id.nil?
|
||||
@updated_issue.pm_sprint_id = @pm_sprint_id unless @pm_sprint_id.nil?
|
||||
@updated_issue.pm_issue_type = @pm_issue_type unless @pm_issue_type.nil?
|
||||
@updated_issue.root_id = @root_id unless @root_id.nil?
|
||||
@updated_issue.root_id = nil if @root_id.zero?
|
||||
@updated_issue.time_scale = @time_scale unless @time_scale.nil?
|
||||
|
||||
@updated_issue.updated_on = Time.now
|
||||
|
|
Loading…
Reference in New Issue