From 87c9730524d2b23d49dc779be1ad789a6d209df8 Mon Sep 17 00:00:00 2001 From: Aldo Mihasi Date: Fri, 3 Mar 2023 11:44:21 +0200 Subject: [PATCH] puplic api return total count in response --- .../publicapi/managers/DataManagementPlanPublicManager.java | 2 -- .../eu/eudat/publicapi/managers/DatasetPublicManager.java | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/dmp-backend/web/src/main/java/eu/eudat/publicapi/managers/DataManagementPlanPublicManager.java b/dmp-backend/web/src/main/java/eu/eudat/publicapi/managers/DataManagementPlanPublicManager.java index 5c8b67824..bf8a6339d 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/publicapi/managers/DataManagementPlanPublicManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/publicapi/managers/DataManagementPlanPublicManager.java @@ -57,8 +57,6 @@ public class DataManagementPlanPublicManager { dataTable.setTotalCount(count); }); CompletableFuture.allOf(itemsFuture, countFuture).join(); - if(dataTable.getTotalCount() > dmpTableRequest.getLength()) - dataTable.setTotalCount((long)dmpTableRequest.getLength()); return dataTable; } diff --git a/dmp-backend/web/src/main/java/eu/eudat/publicapi/managers/DatasetPublicManager.java b/dmp-backend/web/src/main/java/eu/eudat/publicapi/managers/DatasetPublicManager.java index 216c8814e..e94db3db8 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/publicapi/managers/DatasetPublicManager.java +++ b/dmp-backend/web/src/main/java/eu/eudat/publicapi/managers/DatasetPublicManager.java @@ -113,11 +113,7 @@ public class DatasetPublicManager { select(this::mapPublicModel); dataTable.setData(datasetLists.stream().filter(Objects::nonNull).collect(Collectors.toList())); - if(count <= datasetTableRequest.getLength()) - dataTable.setTotalCount(count); - else - dataTable.setTotalCount((long)datasetTableRequest.getLength()); - //CompletableFuture.allOf(countFuture).join(); + dataTable.setTotalCount(count); return dataTable; }