From 706d99aed8985d0a278107295f5f1d26f0b42383 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Fri, 14 Jul 2017 15:52:54 +0000 Subject: Update Pipeline's badge count in Merge Request and Commits view to match real-time content --- app/controllers/projects/commit_controller.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'app/controllers/projects/commit_controller.rb') diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index 14a1e11a6ea..6de125e7e80 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -38,9 +38,14 @@ class Projects::CommitController < Projects::ApplicationController format.json do Gitlab::PollingInterval.set_header(response, interval: 10_000) - render json: PipelineSerializer - .new(project: @project, current_user: @current_user) - .represent(@pipelines) + render json: { + pipelines: PipelineSerializer + .new(project: @project, current_user: @current_user) + .represent(@pipelines), + count: { + all: @pipelines.count + } + } end end end -- cgit v1.2.1