Add book count to menu

This commit is contained in:
aditya.chandel
2024-12-27 12:14:44 -07:00
parent 8aeb361052
commit 8b791e48d4
4 changed files with 28 additions and 6 deletions
@@ -76,4 +76,10 @@ export class LibraryService {
return this.http.get<BookWithNeighborsDTO>(`${this.url}/${libraryId}/book/${bookId}/withNeighbors`);
}
getBookCount(libraryId: number): Observable<number> {
return this.bookService.books$.pipe(
map(books => books.filter(book => book.libraryId === libraryId).length)
);
}
}