Skip to content

Commit ac9d6e2

Browse files
authoredDec 14, 2023
fix(recommend): update TrendingFacetHit facetValue type to string (#1498)
1 parent ea7b9b1 commit ac9d6e2

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export type TrendingFacetHit<TObject> = {
1+
export type TrendingFacetHit = {
22
readonly _score: number;
33
readonly facetName: string;
4-
readonly facetValue: TObject;
4+
readonly facetValue: string;
55
};

‎packages/recommend/src/types/TrendingFacetsResponse.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { SearchResponse } from '@algolia/client-search';
22

33
import { TrendingFacetHit } from './TrendingFacetHit';
44

5-
export type TrendingFacetsResponse<TObject> = Omit<SearchResponse<TObject>, 'hits'> & {
6-
readonly hits: ReadonlyArray<TrendingFacetHit<TObject>>;
5+
export type TrendingFacetsResponse = Omit<SearchResponse, 'hits'> & {
6+
readonly hits: readonly TrendingFacetHit[];
77
};

‎packages/recommend/src/types/WithRecommendMethods.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import { TrendingFacetsResponse } from './TrendingFacetsResponse';
1111
import { TrendingItemsQuery } from './TrendingItemsQuery';
1212
import { TrendingQuery } from './TrendingQuery';
1313

14-
export type RecommendTrendingFacetsQueriesResponse<TObject> = {
14+
export type RecommendTrendingFacetsQueriesResponse = {
1515
/**
1616
* The list of results.
1717
*/
18-
readonly results: ReadonlyArray<TrendingFacetsResponse<TObject>>;
18+
readonly results: readonly TrendingFacetsResponse[];
1919
};
2020

2121
export type RecommendQueriesResponse<TObject> = {
@@ -64,7 +64,7 @@ export type WithRecommendMethods<TType> = TType & {
6464
readonly getTrendingFacets: <TObject>(
6565
queries: readonly TrendingFacetsQuery[],
6666
requestOptions?: RequestOptions & SearchOptions
67-
) => Readonly<Promise<RecommendTrendingFacetsQueriesResponse<TObject>>>;
67+
) => Readonly<Promise<RecommendTrendingFacetsQueriesResponse>>;
6868

6969
/**
7070
* Returns Looking Similar

0 commit comments

Comments
 (0)
Please sign in to comment.