From dc07a2f19fcd04325554c10f78c5ce462002949b Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Sun, 10 May 2026 16:12:10 -0400 Subject: [PATCH] fix(search): add json tags to FieldValue struct for correct API response MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FieldValue struct had no json tags, so Go marshaled fields as uppercase (Value, Count, Score) but frontend expected lowercase (value, count). This caused all autocomplete dropdowns (tags, author, series, language) to silently fail — tagSuggestions[].value was undefined, crashing toLowerCase() calls and producing empty dropdowns. --- internal/services/search.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/services/search.go b/internal/services/search.go index ced6f60..4bc5810 100644 --- a/internal/services/search.go +++ b/internal/services/search.go @@ -111,9 +111,9 @@ type FieldSearchParams struct { // FieldValue represents a single field value with metadata type FieldValue struct { - Value string - Count int64 - Score float64 + Value string `json:"value"` + Count int64 `json:"count"` + Score float64 `json:"score"` } // SearchFieldValues handles field-specific search for autocomplete dropdowns