From 500659be4a34273bc0ccef613497a75638034d81 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Fri, 6 Feb 2026 16:56:26 +0000 Subject: [PATCH] Make partial report suggestion handle hyphens --- rmo/report.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rmo/report.go b/rmo/report.go index 5c0e327b..f031d5c6 100644 --- a/rmo/report.go +++ b/rmo/report.go @@ -30,7 +30,7 @@ func getReportSuggestion(w http.ResponseWriter, r *http.Request) { respondError(w, "You need at least a bit of an 'r'", nil, http.StatusBadRequest) return } - p := strings.ToUpper(partial_report_id) + "%" + p := partialSearchParam(partial_report_id) ctx := r.Context() rows, err := sql.PublicreportPublicIDSuggestion(p).All(ctx, db.PGInstance.BobDB) if err != nil { @@ -133,3 +133,9 @@ func parseLatLng(r *http.Request) (LatLngForm, error) { } return result, nil } + +func partialSearchParam(p string) string { + result := strings.ReplaceAll(p, "-", "") + result = strings.ToUpper(result) + return result + "%" +}