fix: missing last page of search results
1 file changed, 2 insertions(+), 1 deletion(-)
jump to
M internal/server/mux.go → internal/server/mux.go
@@ -7,6 +7,7 @@ "html/template" "io" "log" "log/slog" + "math" "net/http" "net/url" "os"@@ -163,7 +164,7 @@ return } - if page*search.ResultsPerPage > results.Total { + if page > uint64(math.Ceil(float64(results.Total)/search.ResultsPerPage)) { errorHandler(w, r, "Not found", http.StatusNotFound) return