@@ -220,6 +220,9 @@ const searchArgsOf = (props: Props, url: URL, ctx: AppContext) => {
220220 simulationBehavior,
221221 } ;
222222} ;
223+
224+ const DISABLED_QUERY_PARAMS = [ "filter" , "sort" , "term" , "map" , "q" , "page" ] ;
225+
223226const PAGE_TYPE_TO_MAP_PARAM = {
224227 Brand : "brand" ,
225228 Collection : "productClusterIds" ,
@@ -459,7 +462,6 @@ const loader = async (
459462 const hasNextPage = Boolean ( pagination . next . proxyUrl ) ;
460463 const hasPreviousPage = paramnPage > 1 ;
461464 const currentSearchParams = new URLSearchParams ( url . searchParams ) ;
462-
463465 const getPageUrl = ( value : number ) => {
464466 const pageCurrentExist = url . pathname . match ( PAGE_REGEX ) ;
465467 const queryParamns = currentSearchParams . toString ( )
@@ -472,6 +474,8 @@ const loader = async (
472474 : `${ url . pathname } /page${ paramnPage + 1 } ${ queryParamns } ` ;
473475 } ;
474476
477+ const pageIndex = Array . from ( currentSearchParams . keys ( ) ) . some ( key => key . split ( "." ) . some ( paramn => DISABLED_QUERY_PARAMS . includes ( paramn ) ) ) ;
478+
475479 return {
476480 "@type" : "ItemList" ,
477481 breadcrumb : {
@@ -491,11 +495,12 @@ const loader = async (
491495 pageTypes : allPageTypes . map ( parsePageType ) ,
492496 } ,
493497 sortOptions,
494- seo : safeJsonSerialize ( pageTypesToSeo (
498+ seo : { ... safeJsonSerialize ( pageTypesToSeo (
495499 currentPageTypes ,
496500 baseUrl ,
497501 hasPreviousPage ? paramnPage : undefined ,
498- ) ) ,
502+ ) ) ,
503+ noIndexing : pageIndex } ,
499504 } ;
500505} ;
501506export const cache = "stale-while-revalidate" ;
0 commit comments