Checkpoint
This commit is contained in:
+7
-2
@@ -4,6 +4,7 @@ import {BookService} from '../../service/book.service';
|
||||
import {Button} from 'primeng/button';
|
||||
import {InfiniteScrollDirective} from 'ngx-infinite-scroll';
|
||||
import {NgForOf} from '@angular/common';
|
||||
import {Router} from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dashboard-scroller',
|
||||
@@ -26,7 +27,7 @@ export class DashboardScrollerComponent implements OnInit {
|
||||
|
||||
@ViewChild('scrollContainer') scrollContainer!: ElementRef;
|
||||
|
||||
constructor(private bookService: BookService) {
|
||||
constructor(private bookService: BookService, private router: Router) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -67,7 +68,7 @@ export class DashboardScrollerComponent implements OnInit {
|
||||
}
|
||||
|
||||
getAuthorNames(book: Book): string {
|
||||
return book.authors?.map((author) => author.name).join(', ') || 'No authors available';
|
||||
return book.metadata.authors?.map((author) => author.name).join(', ') || 'No authors available';
|
||||
}
|
||||
|
||||
openBook(bookId: number): void {
|
||||
@@ -83,4 +84,8 @@ export class DashboardScrollerComponent implements OnInit {
|
||||
this.loadMore();
|
||||
}
|
||||
}
|
||||
|
||||
openBookInfo(bookId: number) {
|
||||
this.router.navigate(['/book', bookId, 'info']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user