make cursor load from a returned "Next"

This commit is contained in:
john 2025-05-04 00:56:51 +02:00
parent e0a2224544
commit be90a09ce4
2 changed files with 6 additions and 2 deletions

View file

@ -14,7 +14,7 @@ export async function loadPostsForAuthor(
const url = new URL(`authors/${authorId}/posts`, ApiHost)
if (amount != null) url.searchParams.set('amount', amount.toString())
if (cursor != null) url.searchParams.set('cursor', cursor)
if (cursor != null) url.searchParams.set('from', cursor)
const res = await doGetRequest(url)
@ -28,7 +28,7 @@ export async function loadPublicFeed(
const url = new URL(`posts`, ApiHost)
if (amount != null) url.searchParams.set('amount', amount.toString())
if (cursor) url.searchParams.set('cursor', cursor)
if (cursor) url.searchParams.set('from', cursor)
const res = await doGetRequest(url)

View file

@ -138,9 +138,13 @@ export interface components {
}
GetAllPublicPostsResponse: {
posts: components['schemas']['PublicPostDto'][]
/** Format: uuid */
next: string | null
}
GetAuthorPostsResponse: {
posts: components['schemas']['AuthorPostDto'][]
/** Format: uuid */
next: string | null
}
PublicPostAuthorDto: {
/** Format: uuid */