Closed raed667 closed 8 months ago
The trending-facets API only returns type string for facetValue.
trending-facets
string
facetValue
A follow-up on #1494 as other models return items/hits which are of type RecordWithObjectID
RecordWithObjectID
However, trending-facets model returns a list of TrendingFacetHit which (by definition) don't have an objectID property.
objectID
To simplify the code, we can remove the type argument TObject for trending-facets
TObject
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:
getTrendingFacets
type FacetType = { facetName: string; facetValue: string; } const { results } = await client.getTrendingFacets<FacetType>(/**/)
To this:
const { results } = await client.getTrendingFacets(/**/)
BC ok because of low impact
might still worth a minor right?
Why
The
trending-facets
API only returns typestring
forfacetValue
.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 anobjectID
property.How
To simplify the code, we can remove the type argument
TObject
fortrending-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:To this: