How to combine auction winners and organic listings
resolvedBidId is null when the product is not promoted and contain a string ID when it is.
Our goal is to have the pseudo code in place for an endpoint that could create lists of such products.
Shoes category, and there’s 3 or more products available in this category. This code would then output something similar to this:
resolvedBidId field yet, let’s add it.
products.
resolvedBidId to complete this data. But, this time we shouldn’t set it to null, because we’re now dealing with promoted products.
If we assume queryProductsByIds will return products in the same order as the provided ids, we can add the bid IDs as follows:
promoProducts to the products.
However, this can then make products have more elements than our intended page size of 3. So we need to slice it to remain in this page size.