Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Walker <bwalker@gitlab.com>2018-12-03 18:23:38 +0300
committerBrett Walker <bwalker@gitlab.com>2018-12-04 17:44:21 +0300
commit2674830e4df3f6509bd63ebfd048bc6a4e7053ab (patch)
treeddf982d821a7ce32d275f841f6ce3fb14f5a78a9 /app/controllers/boards
parentbba23151a1c0b4dff8f2c31301c5d0589876251d (diff)
Extract code into IssueBoardEntity
Diffstat (limited to 'app/controllers/boards')
-rw-r--r--app/controllers/boards/issues_controller.rb16
1 files changed, 5 insertions, 11 deletions
diff --git a/app/controllers/boards/issues_controller.rb b/app/controllers/boards/issues_controller.rb
index 7f874687212..0dd7500623d 100644
--- a/app/controllers/boards/issues_controller.rb
+++ b/app/controllers/boards/issues_controller.rb
@@ -100,18 +100,12 @@ module Boards
.merge(board_id: params[:board_id], list_id: params[:list_id], request: request)
end
+ def serializer
+ IssueSerializer.new(current_user: current_user)
+ end
+
def serialize_as_json(resource)
- resource.as_json(
- only: [:id, :iid, :project_id, :title, :confidential, :due_date, :relative_position, :weight],
- labels: true,
- issue_endpoints: true,
- include_full_project_path: board.group_board?,
- include: {
- project: { only: [:id, :path] },
- assignees: { only: [:id, :name, :username], methods: [:avatar_url] },
- milestone: { only: [:id, :title] }
- }
- )
+ serializer.represent(resource, serializer: 'board', include_full_project_path: board.group_board?)
end
def whitelist_query_limiting