search
parent
30b7b4ddf7
commit
ed451cdee2
|
|
@ -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 || [];
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue