fix(search): add json tags to FieldValue struct for correct API response

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.
This commit is contained in:
2026-05-10 16:12:10 -04:00
parent fa38ca0d1b
commit dc07a2f19f
+3 -3
View File
@@ -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