Add ability to reset reading progress for a book

This commit is contained in:
aditya.chandel
2025-07-08 17:33:19 -06:00
committed by Aditya Chandel
parent 5afe0a1b0a
commit ceac960943
5 changed files with 88 additions and 13 deletions
@@ -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) {