summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-12-05 10:09:39 +0000
committerDouwe Maan <douwe@gitlab.com>2018-12-05 10:09:39 +0000
commit309ea2827010dc6191a280585787ce8659390c26 (patch)
tree3040bd70f69d618a3641d037afb0b17b553b3c92 /app/controllers
parent00ff9c2f9eee8dffd2329b9a4df98504704e32bd (diff)
parent272c9f11b47c282878f4449f43dc1537299b1ab7 (diff)
downloadgitlab-ce-309ea2827010dc6191a280585787ce8659390c26.tar.gz
Merge branch 'bw-serializer-tech-debit-2' into 'master'
Extract code into IssueBoardEntity / serializer (follow up) See merge request gitlab-org/gitlab-ce!23511
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