minor fixes on products

This commit is contained in:
2026-05-04 00:34:20 +02:00
parent a30a90741e
commit a3498b2d7e

View File

@@ -54,11 +54,17 @@ public class ProviderService {
headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON)); headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
headers.setBearerAuth(token); headers.setBearerAuth(token);
LinkedHashMap response = this.restService.getAs( LinkedHashMap response;
aggregatorUrl + "/merchant/aggregation/products?size=20&clientUid=" + providerId.toString(), try {
headers, response = this.restService.getAs(
LinkedHashMap.class aggregatorUrl + "/merchant/aggregation/products?size=20&clientUid=" + providerId.toString(),
); headers,
LinkedHashMap.class
);
} catch (Exception e) {
log.error("Error fetching products for provider " + providerId, e);
return Collections.emptyList();
}
LinkedHashMap body = (LinkedHashMap) response.get("body"); LinkedHashMap body = (LinkedHashMap) response.get("body");
List<LinkedHashMap> content = (List<LinkedHashMap>) body.get("content"); List<LinkedHashMap> content = (List<LinkedHashMap>) body.get("content");