From 87f6a9c455726ad0cf502a316d98db8da1d1806a Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Tue, 16 Aug 2022 20:00:49 +0200 Subject: consume matches pagination api --- web/pw-server/src/routes/matches/index.svelte | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'web/pw-server/src/routes/matches') diff --git a/web/pw-server/src/routes/matches/index.svelte b/web/pw-server/src/routes/matches/index.svelte index 8de375b..3ae6603 100644 --- a/web/pw-server/src/routes/matches/index.svelte +++ b/web/pw-server/src/routes/matches/index.svelte @@ -15,7 +15,7 @@ bot: botName, }; - let matches = await apiClient.get("/api/matches", removeUndefined(query)); + let { matches, has_next } = await apiClient.get("/api/matches", removeUndefined(query)); // TODO: should this be done client-side? if (query["after"]) { @@ -26,6 +26,8 @@ props: { matches, botName, + hasNext: has_next, + query, }, }; } catch (error) { @@ -47,12 +49,13 @@