master
Boris Voropaev 2024-02-14 14:19:06 +03:00
parent 30b7b4ddf7
commit ed451cdee2
3 changed files with 5 additions and 5 deletions

View File

@ -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 || [];
});
}

View File

@ -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;

View File

@ -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);
});
}