Skip to content

4.22.0

Compare
Choose a tag to compare
@raed667 raed667 released this 14 Dec 16:32
· 11 commits to master since this release
5a2a128

v4.22.0

  • fix(recommend): update TrendingFacetHit facetValue type to string (#1498) (ac9d6e2), closes #1498

Why

The trending-facets API only returns type string for facetValue.

A follow-up on #1494 as other models return items/hits which are of type RecordWithObjectID

However, trending-facets model returns a list of TrendingFacetHit which (by definition) don't have an objectID property.

How

To simplify the code, we can remove the type argument TObject for trending-facets

Impact

If you're not using TypeScript or the trending-facets model, there is nothing to change. You can ignore the following.

Otherwise, you will need to remove the type argument passed to getTrendingFacets and the code goes from this:

type FacetType = {
  facetName: string;
  facetValue: string;
}
const { results } = await client.getTrendingFacets<FacetType>(/**/)

To this:

const { results } = await client.getTrendingFacets(/**/)