Skip to content

Commit

Permalink
fix: Fix default values for pagination in tracker exporters
Browse files Browse the repository at this point in the history
  • Loading branch information
enricocolasante committed Nov 27, 2023
1 parent abcd608 commit 5c12116
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
*/
package org.hisp.dhis.webapi.controller.tracker.export;

import java.util.Objects;
import org.hisp.dhis.common.OpenApi;

/**
Expand Down Expand Up @@ -61,7 +60,7 @@ public interface PageRequestParams {
*/
@OpenApi.Ignore
default boolean isPaged() {
return Objects.requireNonNullElse(getSkipPaging(), true);
return !Boolean.TRUE.equals(getSkipPaging());
}

/** Indicates whether to include the total number of items and pages in the paginated response. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ private static boolean orgUnitModeDoesNotRequireOrgUnit(

public static void validatePaginationParameters(PageRequestParams params)
throws BadRequestException {
if (Boolean.TRUE.equals(params.getSkipPaging())
if (!params.isPaged()
&& (ObjectUtils.firstNonNull(params.getPage(), params.getPageSize()) != null
|| Boolean.TRUE.equals(params.getTotalPages()))) {
throw new BadRequestException(
Expand Down

0 comments on commit 5c12116

Please sign in to comment.