Add buttons to the book description page
This commit is contained in:
committed by
Aditya Chandel
parent
6004c2cbaa
commit
3630b27e37
@@ -77,7 +77,7 @@ export class BookCardComponent implements OnInit {
|
||||
private initMenu() {
|
||||
this.items = [
|
||||
{
|
||||
label: 'Assign Shelves',
|
||||
label: 'Assign Shelf',
|
||||
icon: 'pi pi-folder',
|
||||
command: () => this.openShelfDialog()
|
||||
},
|
||||
|
||||
@@ -50,6 +50,11 @@ export class BookService {
|
||||
).subscribe();
|
||||
}
|
||||
|
||||
getBookByIdFromState(bookId: number): Book | undefined {
|
||||
const currentState = this.bookStateSubject.value;
|
||||
return currentState.books?.find(book => book.id === bookId);
|
||||
}
|
||||
|
||||
updateBookShelves(bookIds: Set<number | undefined>, shelvesToAssign: Set<number | undefined>, shelvesToUnassign: Set<number | undefined>): Observable<Book[]> {
|
||||
const requestPayload = {
|
||||
bookIds: Array.from(bookIds),
|
||||
|
||||
Reference in New Issue
Block a user