try manually paging

This commit is contained in:
2025-12-18 23:33:27 +01:00
parent a029c9b932
commit 8e63df0a45
@@ -717,6 +717,19 @@ public class MembershipManager {
*/
protected List<JsonObject> fetchAllOrderPositions(String path, MultiValueMap<String, String> queryParams,
List<JsonObject> result) {
return fetchAllOrderPositions(path, queryParams, result, 1);
}
/**
* Fetch all order positions.
*
* @param path the path
* @param queryParams the query params
* @param result the result
* @return the list
*/
protected List<JsonObject> fetchAllOrderPositions(String path, MultiValueMap<String, String> queryParams,
List<JsonObject> result, int page) {
JsonElement response = pretixManager.request(path, HttpMethod.GET, queryParams);
if (response == null) {
@@ -732,7 +745,10 @@ public class MembershipManager {
}
if (orderPositions.has("next") && !orderPositions.get("next").isJsonNull()) {
return fetchAllOrderPositions(orderPositions.get("next").getAsString(), new LinkedMultiValueMap<String, String>(), result);
page += 1;
queryParams.remove("page");
queryParams.set("page", String.valueOf(page));
return fetchAllOrderPositions(path, queryParams, result, page);
}
logger.debug("results: " + result.size() + " ? " + queryParams.getFirst("item"));