docs: agy.md — architecture, routes, bugfix, and pending plan
- Fix poller shape mismatch (res.data -> res.data?.data) that caused silent TypeError and 0 posts despite completed galleries (#1) - Align types in api.ts to reflect ApiResponse<PaginatedResponse<>> shape - Comprehensive agy.md documenting architecture, routes, 43 CBZ galleries, known bugs, blocker (API listing), and implementation plan
This commit is contained in:
+2
-2
@@ -55,7 +55,7 @@ export const api = {
|
||||
list: (status?: string, page = 1, perPage = 20) => {
|
||||
const params = new URLSearchParams({ page: String(page), per_page: String(perPage) })
|
||||
if (status) params.set("status", status)
|
||||
return fetchApi<PaginatedResponse<GalleryItem>>(`/galleries?${params}`)
|
||||
return fetchApi<ApiResponse<PaginatedResponse<GalleryItem>>>(`/galleries?${params}`)
|
||||
},
|
||||
|
||||
get: (gid: string) =>
|
||||
@@ -126,7 +126,7 @@ export const api = {
|
||||
list: (status?: string, page = 1, perPage = 20) => {
|
||||
const params = new URLSearchParams({ page: String(page), per_page: String(perPage) })
|
||||
if (status) params.set("status", status)
|
||||
return fetchApi<PaginatedResponse<QueueItem>>(`/queue?${params}`)
|
||||
return fetchApi<ApiResponse<PaginatedResponse<QueueItem>>>(`/queue?${params}`)
|
||||
},
|
||||
|
||||
stats: () =>
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ export async function pollOnce(): Promise<{ newPosts: number }> {
|
||||
|
||||
try {
|
||||
const res = await api.galleries.list("completed", 1, 100)
|
||||
const galleries = res.data || []
|
||||
const galleries = res.data?.data || res.data || []
|
||||
|
||||
for (const g of galleries) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user