github algolia/algoliasearch-client-javascript 4.22.0

latest releases: 5.5.3, 5.5.2, 5.5.1...
9 months ago

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(/**/)

Don't miss a new algoliasearch-client-javascript release

NewReleases is sending notifications on new releases.