diff options
author | Brett Walker <bwalker@gitlab.com> | 2018-11-01 18:07:37 -0500 |
---|---|---|
committer | Brett Walker <bwalker@gitlab.com> | 2018-11-06 10:33:55 -0600 |
commit | 8c126525faba40032244328187ba73a53b6eaf4c (patch) | |
tree | 8ad62c67ea0cd29e0a4592083e759ba6b7383cdc /app/controllers/boards | |
parent | c6d4449f33b57a90d78b3f739ccecc5ab8588e96 (diff) | |
download | gitlab-ce-8c126525faba40032244328187ba73a53b6eaf4c.tar.gz |
Extract code into IssueBoardEntity
Diffstat (limited to 'app/controllers/boards')
-rw-r--r-- | app/controllers/boards/issues_controller.rb | 16 |
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 |