feat: Add support for lowercase and title case keys in custom profile attributes map

This commit is contained in:
Julien Tant (aider)
2025-02-12 14:43:14 -07:00
parent 47ca184876
commit a2292d44ff
@@ -63,16 +63,26 @@ func NewCustomProfileAttributesSelectOptionFromMap(m map[string]any) CustomProfi
name := ""
color := ""
// Check for both "Name" and "name"
if v, ok := m["Name"]; ok {
if vStr, ok := v.(string); ok {
name = vStr
}
} else if v, ok := m["name"]; ok {
if vStr, ok := v.(string); ok {
name = vStr
}
}
// Check for both "Color" and "color"
if v, ok := m["Color"]; ok {
if vStr, ok := v.(string); ok {
color = vStr
}
} else if v, ok := m["color"]; ok {
if vStr, ok := v.(string); ok {
color = vStr
}
}
return NewCustomProfileAttributesSelectOption(name, color)