all repos — searchix @ f9b034027565bbc59b36d1a318716088c3a77977

Search engine for NixOS, nix-darwin, home-manager and NUR users

fix: missing last page of search results

Alan Pearce
commit

f9b034027565bbc59b36d1a318716088c3a77977

parent

3b877b39b424ded0f776d1dc71d07616a47bfbd4

1 file changed, 2 insertions(+), 1 deletion(-)

jump to
M internal/server/mux.gointernal/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