minor fixes on products
This commit is contained in:
@@ -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;
|
||||||
|
try {
|
||||||
|
response = this.restService.getAs(
|
||||||
aggregatorUrl + "/merchant/aggregation/products?size=20&clientUid=" + providerId.toString(),
|
aggregatorUrl + "/merchant/aggregation/products?size=20&clientUid=" + providerId.toString(),
|
||||||
headers,
|
headers,
|
||||||
LinkedHashMap.class
|
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");
|
||||||
|
|||||||
Reference in New Issue
Block a user