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:
Renato
2026-07-24 00:50:15 +02:00
parent 4e9f815a53
commit 269762557e
3 changed files with 351 additions and 3 deletions
+2 -2
View File
@@ -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
View File
@@ -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 {