diff --git a/src/app/_modules/pages/sections/search/search-sections.component.ts b/src/app/_modules/pages/sections/search/search-sections.component.ts index bccdf1b..4744973 100644 --- a/src/app/_modules/pages/sections/search/search-sections.component.ts +++ b/src/app/_modules/pages/sections/search/search-sections.component.ts @@ -25,7 +25,7 @@ export class SearchSectionsComponent { this.controlsSubscription = this.listsService.controls(this.listId).subscribe(controls => { this.fetch(controls); }); - this.resultsSubscription = this.listsService.result(this.listId).subscribe(val => { + this.resultsSubscription = this.listsService.result(this.listId)?.subscribe(val => { this.items = val?.data || []; }); } diff --git a/src/app/_modules/pagination/pagination.component.ts b/src/app/_modules/pagination/pagination.component.ts index d0452a8..be9448c 100644 --- a/src/app/_modules/pagination/pagination.component.ts +++ b/src/app/_modules/pagination/pagination.component.ts @@ -38,7 +38,7 @@ export class PaginationComponent { return (val < this.data?.total) ? val : this.data?.total; } get currentPage() { - return this.listsService.result(this.listId).value.meta?.pagination?.currentPage; + return this.listsService.result(this.listId).value?.meta?.pagination?.currentPage; } get total() { return this.data?.totalPages || 1; diff --git a/src/app/_modules/search/page/search-page.component.ts b/src/app/_modules/search/page/search-page.component.ts index 8f13ca7..7702648 100644 --- a/src/app/_modules/search/page/search-page.component.ts +++ b/src/app/_modules/search/page/search-page.component.ts @@ -24,13 +24,13 @@ export class SearchPageComponent { entriesSubscription: Subscription; constructor(private listsService: ListsService) { - this.pagesSubscription = this.listsService.result('sections-list').subscribe(res => { + this.pagesSubscription = this.listsService.result('sections-list')?.subscribe(res => { this.setCount('pages', res?.meta?.pagination?.total); }); - this.publicationsSubscription = this.listsService.result('publications-list').subscribe(res => { + this.publicationsSubscription = this.listsService.result('publications-list')?.subscribe(res => { this.setCount('publications', res?.meta?.pagination?.total); }); - this.entriesSubscription = this.listsService.result('common-entries').subscribe(res => { + this.entriesSubscription = this.listsService.result('common-entries')?.subscribe(res => { this.setCount('entries', res?.meta?.pagination?.total); }); }