categories to db
This commit is contained in:
@ -48,6 +48,20 @@ type Category struct {
|
||||
CanAdd bool `json:"can_add"`
|
||||
}
|
||||
|
||||
func (c *Category) GetName() string {
|
||||
if len(c.Name) == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
for _, n := range c.Name {
|
||||
if n.Locale == "ru-RU" {
|
||||
return n.Value
|
||||
}
|
||||
}
|
||||
|
||||
return c.Name[0].Value
|
||||
}
|
||||
|
||||
type CategoriesResponse struct {
|
||||
Retval int `json:"retval"`
|
||||
Retdesc any `json:"retdesc"`
|
||||
|
Reference in New Issue
Block a user