File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
adapter/search-request-adapter Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -59,8 +59,11 @@ export function adaptSearchParams(
5959
6060 const placeholderSearch = searchContext . placeholderSearch
6161 const query = searchContext . query
62+
63+ // Pagination
6264 const { pagination } = searchContext
63- // Limit
65+
66+ // Limit based on pagination preferences
6467 if (
6568 ( ! placeholderSearch && query === '' ) ||
6669 pagination . paginationTotalHits === 0
Original file line number Diff line number Diff line change @@ -38,12 +38,11 @@ export function SearchResolver(cache: SearchCacheInterface) {
3838 searchContext . query ,
3939 paginationCache ,
4040 ] )
41- const entry = cache . getEntry ( key )
41+ const cachedResponse = cache . getEntry ( key )
4242
43- // Request is cached.
44- if ( entry ) return entry
43+ // Check if specific request is already cached with its associated search response .
44+ if ( cachedResponse ) return cachedResponse
4545
46- // Cache filters: todo components
4746 const facetsCache = extractFacets ( searchContext , searchParams )
4847
4948 // Make search request
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ export type PaginationContext = {
6868 hitsPerPage : number
6969 page : number
7070}
71+
7172export type PaginationParams = {
7273 paginationTotalHits ?: number
7374 hitsPerPage ?: number
You can’t perform that action at this time.
0 commit comments