feat: implement pagination for feed retrieval and update frontend components
All checks were successful
Build and Deploy Thoughts / build-and-deploy-local (push) Successful in 2m7s

This commit is contained in:
2025-09-09 03:43:06 +02:00
parent 4ea4f3149f
commit 64806f8bd4
5 changed files with 236 additions and 29 deletions

View File

@@ -168,11 +168,11 @@ export const loginUser = (data: z.infer<typeof LoginSchema>) =>
body: JSON.stringify(data),
}, z.object({ token: z.string() }));
export const getFeed = (token: string) =>
export const getFeed = (token: string, page: number = 1, pageSize: number = 20) =>
apiFetch(
"/feed",
`/feed?page=${page}&page_size=${pageSize}`,
{},
z.object({ thoughts: z.array(ThoughtSchema) }),
z.object({ items: z.array(ThoughtSchema), totalPages: z.number() }),
token
);