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:
@@ -111,9 +111,9 @@ type FieldSearchParams struct {
|
|||||||
|
|
||||||
// FieldValue represents a single field value with metadata
|
// FieldValue represents a single field value with metadata
|
||||||
type FieldValue struct {
|
type FieldValue struct {
|
||||||
Value string
|
Value string `json:"value"`
|
||||||
Count int64
|
Count int64 `json:"count"`
|
||||||
Score float64
|
Score float64 `json:"score"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SearchFieldValues handles field-specific search for autocomplete dropdowns
|
// SearchFieldValues handles field-specific search for autocomplete dropdowns
|
||||||
|
|||||||
Reference in New Issue
Block a user