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:
Git Agent
2026-08-23 10:32:44 +02:00
parent e94524f119
commit 85b56ef3b2
12 changed files with 254 additions and 54 deletions

View File

@ -17,7 +17,7 @@ export class ProgressController {
@Get(":bookId")
get(@CurrentUserParam() user: CurrentUser, @Param("bookId") bookId: string) {
return this.progress.get(user.id, Number(bookId));
return this.progress.find(user.id, Number(bookId));
}
@Put(":bookId")

View File

@ -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) {