diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-08-19 12:17:46 -0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-08-31 09:30:37 +0100 |
commit | 246bb231c377e2b8a6696811a200d6ac8072cebe (patch) | |
tree | 9427569a8f3b3efd21ece8593145f7031e741137 /app/controllers/projects | |
parent | 4d042afeced540c0acd887714d8ec7c962b7c507 (diff) | |
download | gitlab-ce-246bb231c377e2b8a6696811a200d6ac8072cebe.tar.gz |
Returns the total number of issues in the JSON response
Diffstat (limited to 'app/controllers/projects')
-rw-r--r-- | app/controllers/projects/boards/issues_controller.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/app/controllers/projects/boards/issues_controller.rb b/app/controllers/projects/boards/issues_controller.rb index 1a4f6b50e8f..9404612a993 100644 --- a/app/controllers/projects/boards/issues_controller.rb +++ b/app/controllers/projects/boards/issues_controller.rb @@ -8,12 +8,15 @@ module Projects issues = ::Boards::Issues::ListService.new(project, current_user, filter_params).execute issues = issues.page(params[:page]) - render json: issues.as_json( - only: [:iid, :title, :confidential], - include: { - assignee: { only: [:id, :name, :username], methods: [:avatar_url] }, - labels: { only: [:id, :title, :description, :color, :priority], methods: [:text_color] } - }) + render json: { + issues: issues.as_json( + only: [:iid, :title, :confidential], + include: { + assignee: { only: [:id, :name, :username], methods: [:avatar_url] }, + labels: { only: [:id, :title, :description, :color, :priority], methods: [:text_color] } + }), + size: issues.total_count + } end def update |