refactor: Remove series-related fields and components to streamline novel management
Build and Push Reader Image / docker (push) Successful in 41s
Build and Push Reader Image / docker (push) Successful in 41s
- Eliminated seriesId and related fields from various models and components to simplify the data structure. - Updated UI components to reflect the removal of series dependencies, enhancing clarity and maintainability. - Adjusted API calls and data handling to ensure compatibility with the new structure.
This commit is contained in:
@@ -18,7 +18,6 @@ type BrowseNovel = {
|
||||
views: number
|
||||
totalChapters: number
|
||||
status: string
|
||||
seriesId?: string | null
|
||||
}
|
||||
|
||||
type BrowseResponse = {
|
||||
@@ -34,24 +33,6 @@ type GenreItem = {
|
||||
slug: string
|
||||
}
|
||||
|
||||
function collapseSeriesRows<T extends { id: string; seriesId?: string | null }>(rows: T[]): T[] {
|
||||
const pickedSeries = new Set<string>()
|
||||
const output: T[] = []
|
||||
|
||||
for (const row of rows) {
|
||||
if (!row.seriesId) {
|
||||
output.push(row)
|
||||
continue
|
||||
}
|
||||
|
||||
if (pickedSeries.has(row.seriesId)) continue
|
||||
pickedSeries.add(row.seriesId)
|
||||
output.push(row)
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
function buildBrowsePath(params: Record<string, string>) {
|
||||
const search = new URLSearchParams(params)
|
||||
return `/api/novels/browse?${search.toString()}`
|
||||
@@ -100,7 +81,6 @@ export default async function SearchPage({
|
||||
status: statusFilter === "all" ? "" : statusFilter,
|
||||
page: String(requestedPage),
|
||||
limit: String(PAGE_SIZE),
|
||||
collapse_series: "true",
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user