Add ability to reset reading progress for a book
This commit is contained in:
committed by
Aditya Chandel
parent
5afe0a1b0a
commit
ceac960943
@@ -397,6 +397,12 @@ export class BookService {
|
||||
);
|
||||
}
|
||||
|
||||
resetProgress(bookId: number): Observable<Book> {
|
||||
return this.http.post<Book>(`${this.url}/${bookId}/reset-progress`, null).pipe(
|
||||
tap(updatedBook => this.handleBookUpdate(updatedBook))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/*------------------ All the websocket handlers go below ------------------*/
|
||||
|
||||
@@ -436,7 +442,7 @@ export class BookService {
|
||||
updatedMap.has(book.id) ? updatedMap.get(book.id)! : book
|
||||
);
|
||||
|
||||
this.bookStateSubject.next({ ...currentState, books: mergedBooks });
|
||||
this.bookStateSubject.next({...currentState, books: mergedBooks});
|
||||
}
|
||||
|
||||
handleBookMetadataUpdate(bookId: number, updatedMetadata: BookMetadata) {
|
||||
|
||||
Reference in New Issue
Block a user