Skip to content

Commit

Permalink
fix: set request parameter to null when there is no variant
Browse files Browse the repository at this point in the history
  • Loading branch information
brunopacheco1 committed Nov 29, 2024
1 parent 81f1a1c commit 6efe096
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public Map<String, Integer> collect(DatasetSearchQuery query, String accessToken

var beaconQuery = BeaconIndividualsRequestMapper.from(query);

if (beaconAuthorization == null || beaconQuery.getQuery().getFilters().isEmpty()) {
if (beaconAuthorization == null || (beaconQuery.getQuery().getFilters().isEmpty() &&
beaconQuery.getQuery().getRequestParameters().isEmpty())) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public BeaconIndividualsRequest from(
.testMode(false)
.pagination(new BeaconIndividualsRequestQueryPagination())
.filters(beaconFilters)
.requestParameters(requestParameters)
.requestParameters(requestParameters.isEmpty() ? null : requestParameters)
.build())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void shouldAcceptNullQuery() {
.skip(0)
.build())
.filters(List.of())
.requestParameters(List.of())
.requestParameters(null)
.build())
.build());
}
Expand All @@ -71,7 +71,7 @@ void shouldAcceptEmptyQuery() {
.skip(0)
.build())
.filters(List.of())
.requestParameters(List.of())
.requestParameters(null)
.build())
.build());
}
Expand All @@ -97,7 +97,7 @@ void shouldAcceptEmptyFacets() {
.skip(0)
.build())
.filters(List.of())
.requestParameters(List.of())
.requestParameters(null)
.build())
.build());
}
Expand Down

0 comments on commit 6efe096

Please sign in to comment.