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
@@ -66,4 +66,10 @@ export class ShelfService {
})
);
}
getBookCount(shelfId: number): Observable<number> {
return this.bookService.books$.pipe(
map(books => books.filter(book => book.shelves?.some(shelf => shelf.id === shelfId)).length)
);
}
}