新增:里程碑列表支持id查询
This commit is contained in:
parent
4c26085e58
commit
ff025e07dd
|
@ -7,7 +7,7 @@ class Api::V1::Issues::MilestonesController < Api::V1::BaseController
|
|||
# 里程碑列表
|
||||
def index
|
||||
@milestones = @project.versions
|
||||
@milestones = @milestones.ransack(name_or_description_cont: params[:keyword]).result if params[:keyword].present?
|
||||
@milestones = @milestones.ransack(id_eq: params[:keyword]).result.or(@milestones.ransack(name_or_description_cont: params[:keyword]).result) if params[:keyword].present?
|
||||
@closed_milestone_count = @milestones.closed.size
|
||||
@opening_milestone_count = @milestones.opening.size
|
||||
@milestones = params[:category] == "closed" ? @milestones.closed : @milestones.opening
|
||||
|
|
Loading…
Reference in New Issue