Add support for bulk reading progress reset
This commit is contained in:
committed by
Aditya Chandel
parent
ec7846abf6
commit
77d68108ab
@@ -397,9 +397,10 @@ 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))
|
||||
resetProgress(bookIds: number | number[]): Observable<Book[]> {
|
||||
const ids = Array.isArray(bookIds) ? bookIds : [bookIds];
|
||||
return this.http.post<Book[]>(`${this.url}/reset-progress`, ids).pipe(
|
||||
tap(updatedBooks => updatedBooks.forEach(book => this.handleBookUpdate(book)))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user