Commit 6af8547a authored by Valery Sizov's avatar Valery Sizov

[Issue board sorting] Set position for unpositioning issues when view[ci skip]

Actually I think we could avoid doing it so because it does not look efficient.
But we can improve it later.
parent 34bf798e
...@@ -8,6 +8,7 @@ module Projects ...@@ -8,6 +8,7 @@ module Projects
def index def index
issues = ::Boards::Issues::ListService.new(project, current_user, filter_params).execute issues = ::Boards::Issues::ListService.new(project, current_user, filter_params).execute
issues = issues.page(params[:page]).per(params[:per] || 20) issues = issues.page(params[:page]).per(params[:per] || 20)
make_sure_position_is_set(issues)
render json: { render json: {
issues: serialize_as_json(issues), issues: serialize_as_json(issues),
...@@ -38,6 +39,12 @@ module Projects ...@@ -38,6 +39,12 @@ module Projects
private private
def make_sure_position_is_set(issues)
issues.each do |issue|
issue.move_to_end unless issue.relative_position
end
end
def issue def issue
@issue ||= @issue ||=
IssuesFinder.new(current_user, project_id: project.id) IssuesFinder.new(current_user, project_id: project.id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment