@@ -123,6 +123,7 @@ public async Task<IActionResult> Index(int pageIndex = 1, string term = null)
123123 BookmarkId = t . BookmarkId ,
124124 NodeId = int . Parse ( t . Id ) ,
125125 BadgeUrl = t . BadgeUrl ,
126+ Providers = t . Providers ,
126127 } ) . ToList ( ) ;
127128 }
128129 else
@@ -551,5 +552,70 @@ public async Task<IActionResult> RequestPreviewAccess(CatalogueRequestAccessView
551552 return this . View ( "RequestPreviewAccess" , viewModel ) ;
552553 }
553554 }
555+
556+ /// <summary>
557+ /// Get all catelogues, filter and pagination based on alphabets.
558+ /// </summary>
559+ /// <param name="filterChar">filterChar.</param>
560+ /// <returns>rk.</returns>
561+ [ Route ( "/allcatalogue" ) ]
562+ [ Route ( "/allcatalogue/{filterChar}" ) ]
563+ public async Task < IActionResult > GetAllCatalogue ( string filterChar = "a" )
564+ {
565+ var pageSize = this . settings . AllCataloguePageSize ;
566+ var catalogues = await this . catalogueService . GetAllCatalogueAsync ( filterChar , pageSize ) ;
567+ return this . View ( "allcatalogue" , catalogues ) ;
568+ }
569+
570+ /// <summary>
571+ /// AllCatalogues Search.
572+ /// </summary>
573+ /// <param name="pageIndex">pageIndex.</param>
574+ /// <param name="term">Search term.</param>
575+ /// <returns>IActionResult.</returns>
576+ [ Route ( "/allcataloguesearch" ) ]
577+ public async Task < IActionResult > GetAllCatalogueSearch ( int pageIndex = 1 , string term = null )
578+ {
579+ var catalogues = new AllCatalogueSearchResponseViewModel ( ) ;
580+ var searchString = term ? . Trim ( ) ?? string . Empty ;
581+ var allCatalogueSearchPageSize = this . settings . FindwiseSettings . AllCatalogueSearchPageSize ;
582+
583+ if ( ! string . IsNullOrWhiteSpace ( term ) )
584+ {
585+ var termCatalogues = await this . searchService . GetAllCatalogueSearchResultAsync (
586+ new AllCatalogueSearchRequestModel
587+ {
588+ SearchText = searchString ,
589+ PageIndex = pageIndex - 1 ,
590+ PageSize = allCatalogueSearchPageSize ,
591+ } ) ;
592+
593+ catalogues . TotalCount = termCatalogues . TotalHits ;
594+ catalogues . Catalogues = termCatalogues . DocumentModel . Select ( t => new AllCatalogueViewModel
595+ {
596+ Url = t . Url ,
597+ Name = t . Name ,
598+ CardImageUrl = t . CardImageUrl ,
599+ BannerUrl = t . BannerUrl ,
600+ Description = t . Description ,
601+ RestrictedAccess = t . RestrictedAccess ,
602+ HasAccess = t . HasAccess ,
603+ IsBookmarked = t . IsBookmarked ,
604+ BookmarkId = t . BookmarkId ,
605+ NodeId = int . Parse ( t . Id ) ,
606+ BadgeUrl = t . BadgeUrl ,
607+ Providers = t . Providers ,
608+ } ) . ToList ( ) ;
609+ }
610+ else
611+ {
612+ catalogues . TotalCount = 0 ;
613+ catalogues . Catalogues = new List < AllCatalogueViewModel > ( ) ;
614+ }
615+
616+ this . ViewBag . PageIndex = pageIndex ;
617+ this . ViewBag . PageSize = allCatalogueSearchPageSize ;
618+ return this . View ( "AllCatalogueSearch" , catalogues ) ;
619+ }
554620 }
555621}
0 commit comments