Checkpoint

This commit is contained in:
aditya.chandel
2024-12-15 18:03:31 -07:00
parent 96a04621e1
commit 95e0d27de4
68 changed files with 1234 additions and 431 deletions
@@ -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']);
}
}