From 38653bf4a6c4d1adcaf08da1d9d890c412de3d0f Mon Sep 17 00:00:00 2001 From: Adam Veldhousen Date: Sat, 20 May 2023 01:25:03 -0500 Subject: [PATCH] no idea why shit isn't updating weee --- src/catalog/internal/handler.go | 2 +- src/web-client/src/routes/+layout.svelte | 6 +++--- src/web-client/src/routes/+layout.ts | 4 ++-- src/web-client/src/routes/+page.svelte | 18 +++++++++++++++++- src/web-client/src/routes/+page.ts | 6 ++++-- 5 files changed, 27 insertions(+), 9 deletions(-) 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} +
  1. <Previous
  2. + {:else} +
  3. + {/if} +
  4. Page {currentPage} of {pageCount}
  5. + {#if currentPage < pageCount} +
  6. Next>
  7. + {/if} +
+