mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
新增:批量更新迭代中工作项
This commit is contained in:
@@ -32,6 +32,34 @@ class Api::Pm::SprintIssuesController < Api::Pm::BaseController
|
||||
end
|
||||
render_ok(data: data)
|
||||
end
|
||||
|
||||
before_action :load_uncomplete_issues, only: [:complete]
|
||||
|
||||
def complete
|
||||
begin
|
||||
case complete_params[:complete_type].to_i
|
||||
when 1
|
||||
@issues.update_all(status_id: 5)
|
||||
when 2
|
||||
@issues.update_all(pm_sprint_id: 0)
|
||||
when 3
|
||||
@issues.update_all(pm_sprint_id: complete_params[:target_pm_project_sprint_id])
|
||||
end
|
||||
render_ok
|
||||
rescue => e
|
||||
render_error(e.message)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def load_uncomplete_issues
|
||||
@issues = Issue.where(pm_sprint_id: complete_params[:pm_project_sprint_id]).where.not(status_id: 5)
|
||||
end
|
||||
|
||||
def complete_params
|
||||
params.permit(:pm_project_sprint_id, :complete_type, :target_pm_project_sprint_id)
|
||||
end
|
||||
|
||||
def query_params
|
||||
params.permit(
|
||||
|
||||
Reference in New Issue
Block a user