diff --git a/src/catalog/internal/handler.go b/src/catalog/internal/handler.go
index 2f1c274..44de446 100644
--- a/src/catalog/internal/handler.go
+++ b/src/catalog/internal/handler.go
@@ -29,7 +29,7 @@ type catalogHandler struct {
}
func (rh *catalogHandler) GetUpcoming(ctx context.Context, cmd *api.AuctionSearchCriteria) (out *api.GetUpcomingResult, err error) {
- page := int(math.Min(1, float64(cmd.GetPage())))
+ page := int(math.Max(0, float64(cmd.GetPage())))
pageSize := int(cmd.GetLimit())
if pageSize < 32 {
diff --git a/src/web-client/src/routes/+layout.svelte b/src/web-client/src/routes/+layout.svelte
index 6b09097..2408911 100644
--- a/src/web-client/src/routes/+layout.svelte
+++ b/src/web-client/src/routes/+layout.svelte
@@ -1,14 +1,14 @@
{#if hasResults}
-
{data?.results.length} of {data?.total} Upcoming & Live Auctions
+
+ {data?.results.length} of {data?.total} Upcoming & Live Auctions
+
+ {#if currentPage > 1}
+ - <Previous
+ {:else}
+
+ {/if}
+ - Page {currentPage} of {pageCount}
+ {#if currentPage < pageCount}
+ - Next>
+ {/if}
+
+
{#each data?.results as auction, i}
diff --git a/src/web-client/src/routes/+page.ts b/src/web-client/src/routes/+page.ts
index 5880ec3..f4b9f4d 100644
--- a/src/web-client/src/routes/+page.ts
+++ b/src/web-client/src/routes/+page.ts
@@ -4,9 +4,11 @@ const API_HOST = 'http://localhost:8000/api/v1'
export const load = (async ({ fetch, url }) => {
const searchTerm = url.searchParams.get('query') || '';
- const currentPage = url.searchParams.get('page') || 1;
+ const currentPage = url.searchParams.get('page') || 0;
+ const currentLimit = url.searchParams.get('limit') || 64;
+
try {
- const response = await fetch(API_HOST + `/upcoming?searchTerm=${searchTerm}&page=${currentPage}`);
+ const response = await fetch(API_HOST + `/upcoming?searchTerm=${searchTerm}&page=${currentPage}&limit=${currentLimit}`);
const { page, total, results } = await response.json() || {};
return {