From d65abcaf29d9fb0046cd0dadc365b8538cb13f28 Mon Sep 17 00:00:00 2001 From: Quentin AUBERT Date: Fri, 10 Jan 2025 09:52:40 +0100 Subject: [PATCH] FIX wrong count of api return by visibleApis graphql query --- daikoku/app/domain/CommonServices.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daikoku/app/domain/CommonServices.scala b/daikoku/app/domain/CommonServices.scala index 12ebbc397..c13262bdd 100644 --- a/daikoku/app/domain/CommonServices.scala +++ b/daikoku/app/domain/CommonServices.scala @@ -488,6 +488,9 @@ object CommonServices { ) ) } yield { + val count = paginateApis._1.filter(api => + api.isPublished || myTeams.exists(api.team == _.id) + ).size val sortedApis: Seq[ApiWithAuthorizations] = uniqueApisWithVersion .filter(api => api.isPublished || myTeams.exists(api.team == _.id) @@ -529,7 +532,7 @@ object CommonServices { case _ => ApiWithAuthorizations(api = api, plans = apiPlans) }) } - ApiWithCount(sortedApis, producerTeams, sortedApis.size) + ApiWithCount(sortedApis, producerTeams, count) } }) }