diff --git a/src/app/api/komga/books/[bookId]/read-progress/route.ts b/src/app/api/komga/books/[bookId]/read-progress/route.ts index da50fc3..bc8285d 100644 --- a/src/app/api/komga/books/[bookId]/read-progress/route.ts +++ b/src/app/api/komga/books/[bookId]/read-progress/route.ts @@ -22,3 +22,15 @@ export async function PATCH(request: Request, { params }: { params: { bookId: st ); } } +export async function DELETE(request: Request, { params }: { params: { bookId: string } }) { + try { + await BookService.updateReadProgress(params.bookId, 1, false); + return NextResponse.json({ message: "Progression supprimée avec succès" }); + } catch (error) { + console.error("API Delete Read Progress - Erreur:", error); + return NextResponse.json( + { error: "Erreur lors de la suppression de la progression" }, + { status: 500 } + ); + } +} diff --git a/src/components/series/BookGrid.tsx b/src/components/series/BookGrid.tsx index 5180618..a039b0a 100644 --- a/src/components/series/BookGrid.tsx +++ b/src/components/series/BookGrid.tsx @@ -4,6 +4,7 @@ import { KomgaBook } from "@/types/komga"; import { formatDate } from "@/lib/utils"; import { Cover } from "@/components/ui/cover"; import { MarkAsReadButton } from "@/components/ui/mark-as-read-button"; +import { MarkAsUnreadButton } from "@/components/ui/mark-as-unread-button"; import { BookOfflineButton } from "@/components/ui/book-offline-button"; import { useState, useEffect } from "react"; @@ -78,6 +79,19 @@ export function BookGrid({ books, onBookClick }: BookGridProps) { ); }; + const handleMarkAsUnread = (bookId: string) => { + setLocalBooks((prevBooks) => + prevBooks.map((book) => + book.id === bookId + ? { + ...book, + readProgress: null, + } + : book + ) + ); + }; + return (