change response for index to name for issue
This commit is contained in:
parent
23e8bea507
commit
afe87a2ff1
|
@ -50,7 +50,23 @@ class IssuesController < ApplicationController
|
|||
end
|
||||
|
||||
def index_to_name
|
||||
issues_result = @project.issues.where(project_issues_index:params[:index]).map{|e|{id:e.id,project_issues_index:e.project_issues_index,subject:e.subject}}
|
||||
issues_index = params[:index].map(&:to_i)
|
||||
exit_index = []
|
||||
issues_result = @project.issues.where(project_issues_index:issues_index).map{ |e|
|
||||
exit_index << e.project_issues_index
|
||||
{
|
||||
id:e.id,
|
||||
project_issues_index:e.project_issues_index,
|
||||
subject:e.subject
|
||||
}
|
||||
|
||||
}
|
||||
not_exit = issues_index - exit_index
|
||||
not_exit.map{|e|
|
||||
issues_result << {id: nil,
|
||||
project_issues_index:e,
|
||||
subject: nil}
|
||||
}
|
||||
render json: issues_result
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue