categories to db

This commit is contained in:
2023-12-21 20:52:47 +03:00
parent 96b7e49fa2
commit ed1716232a
4 changed files with 146 additions and 72 deletions

View File

@ -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"`