Refactor API routes and remove unused endpoints
- Deleted the following API routes: - `upload-cover` - `truyen/[id]/chapters` - `truyen/[id]/comments` - `truyen/[id]/rate` - `truyen/suggest` - `user/bookmarks` - `user/recommendations` - `user/settings` - Updated `chapter-client.tsx` and `novel-client.tsx` to handle error messages more gracefully. - Adjusted pagination logic in `tim-kiem/page.tsx` to improve user experience. - Added support for additional search parameters in the search functionality. - Introduced API rewrites in `next.config.mjs` to route requests to a reader API.
This commit is contained in:
@@ -835,7 +835,7 @@ export function NovelClient() {
|
||||
|
||||
const data = await res.json()
|
||||
if (!res.ok) {
|
||||
throw new Error(data.error || "Không thể phân tích EPUB")
|
||||
throw new Error(data.error || data.detail || "Không thể phân tích EPUB")
|
||||
}
|
||||
|
||||
setEpubPreviewData(data)
|
||||
@@ -1199,7 +1199,7 @@ export function NovelClient() {
|
||||
setNewSeriesName("")
|
||||
}
|
||||
if (data.genres && Array.isArray(data.genres)) {
|
||||
setSelectedGenres(data.genres.map((g: any) => g.genreId))
|
||||
setSelectedGenres(data.genres.map((g: any) => g.id))
|
||||
} else {
|
||||
setSelectedGenres([])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user