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