summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-11-06 18:33:13 +0000
committerDouwe Maan <douwe@gitlab.com>2018-11-06 18:33:13 +0000
commitaa9a662b666b3ca85f5165cb52c18bbfb6d8d3f0 (patch)
treef85927af707bdf48de9b2ee0aa7b438790331fe0 /app/controllers
parent15f1952e303e4f089e9285a87779db9f1ad3c231 (diff)
parent8c126525faba40032244328187ba73a53b6eaf4c (diff)
downloadgitlab-ce-aa9a662b666b3ca85f5165cb52c18bbfb6d8d3f0.tar.gz
Merge branch 'bw-serializer-tech-debit' into 'master'
Extract code into IssueBoardEntity / serializer See merge request gitlab-org/gitlab-ce!22760
Diffstat (limited to 'app/controllers')
-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