From be90a09ce4b5522cb8ed87a405cb01fc2e1d0405 Mon Sep 17 00:00:00 2001 From: john Date: Sun, 4 May 2025 00:56:51 +0200 Subject: [PATCH] make cursor load from a returned "Next" --- src/api/api.ts | 4 ++-- src/api/schema.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api/api.ts b/src/api/api.ts index 2f253de..a2e533b 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -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) diff --git a/src/api/schema.ts b/src/api/schema.ts index cdd48ca..b58d94e 100644 --- a/src/api/schema.ts +++ b/src/api/schema.ts @@ -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 */