Implement refresh library

This commit is contained in:
aditya.chandel
2024-12-26 14:36:55 -07:00
parent f3bf5e9c0b
commit bc1aa39b34
18 changed files with 214 additions and 32 deletions
@@ -158,4 +158,17 @@ export class BookService {
this.books.next(updatedBooks);
}
handleRemovedBookIds(removedBookIds: Set<number>) {
console.log(removedBookIds);
if (!(removedBookIds instanceof Set)) {
console.error("removedBookIds should be a Set");
return; // Or throw an error if preferred
}
const currentBooks = this.books.getValue();
let filteredBooks = currentBooks.filter(currentBook => !removedBookIds.has(currentBook.id));
this.books.next(filteredBooks);
}
}