| Line 947... |
Line 947... |
| 947 |
dealResponse = dealResponse.stream().sorted(Comparator.comparing(x -> webProductsFinal.indexOf(x.getCatalogId()))).collect(Collectors.toList());
|
947 |
dealResponse = dealResponse.stream().sorted(Comparator.comparing(x -> webProductsFinal.indexOf(x.getCatalogId()))).collect(Collectors.toList());
|
| 948 |
}
|
948 |
}
|
| 949 |
}
|
949 |
}
|
| 950 |
query.webListing.setFofoCatalogResponses(dealResponse);
|
950 |
query.webListing.setFofoCatalogResponses(dealResponse);
|
| 951 |
}
|
951 |
}
|
| - |
|
952 |
// Drop listings that resolved to zero products so the client doesn't
|
| - |
|
953 |
// paint an empty "Price Drop Models (0)" tab. A listing can go empty
|
| - |
|
954 |
// because the source-of-truth cron produced no rows for it or because
|
| - |
|
955 |
// the Solr query filtered them all out for this partner. Empty tabs
|
| - |
|
956 |
// are useless to the user, so hide them here — one fix serves both
|
| - |
|
957 |
// the React and Angular apps.
|
| - |
|
958 |
webListings.removeIf(wl -> wl.getFofoCatalogResponses() == null
|
| - |
|
959 |
|| wl.getFofoCatalogResponses().isEmpty());
|
| 952 |
return responseSender.ok(webListings);
|
960 |
return responseSender.ok(webListings);
|
| 953 |
}
|
961 |
}
|
| 954 |
|
962 |
|
| 955 |
private List<FofoCatalogResponse> getDealResponses(UserInfo userInfo, FofoStore fs, WebListing webListing, int offset, int limit) throws Exception {
|
963 |
private List<FofoCatalogResponse> getDealResponses(UserInfo userInfo, FofoStore fs, WebListing webListing, int offset, int limit) throws Exception {
|
| 956 |
ListingQuery query = buildListingQuery(webListing, fs.getWarehouseId(), offset, limit);
|
964 |
ListingQuery query = buildListingQuery(webListing, fs.getWarehouseId(), offset, limit);
|