fix(web,api): UI fiche livre et lecteur — progression, locators EPUB/PDF, styles
- web: BookPage/ReaderPage enrichis, sauvegarde de progression lecteur - web: locators EPUB/PDF normalisés (+ tests), EpubReader/PdfReader ajustés - web: nginx et service worker ajustés - api: progress — corrections contrôleur/service Refs: #13
This commit is contained in:
@ -30,6 +30,14 @@ export class ProgressService {
|
||||
}
|
||||
|
||||
get(userId: number, bookId: number) {
|
||||
const row = this.find(userId, bookId);
|
||||
if (!row) {
|
||||
throw new NotFoundException("Progress not found");
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
find(userId: number, bookId: number) {
|
||||
const row = this.database.db
|
||||
.select({
|
||||
bookId: progress.bookId,
|
||||
@ -40,10 +48,7 @@ export class ProgressService {
|
||||
.from(progress)
|
||||
.where(sql`${progress.userId} = ${userId} AND ${progress.bookId} = ${bookId}`)
|
||||
.get();
|
||||
if (!row) {
|
||||
throw new NotFoundException("Progress not found");
|
||||
}
|
||||
return row;
|
||||
return row ?? null;
|
||||
}
|
||||
|
||||
continueReading(userId: number) {
|
||||
|
||||
Reference in New Issue
Block a user