feat: add groups to the content.node.item response

This commit is contained in:
Daniel Thomas 2022-06-09 11:54:46 +02:00
parent f3366f5211
commit cac32f2d52
2 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,7 @@ type Item struct {
MimeType string `json:"mimeType"`
Hidden bool `json:"hidden,omitempty"`
Data map[string]interface{} `json:"data"`
Groups []string `json:"groups"`
}
// NewItem item contructor

View File

@ -80,7 +80,7 @@ func (node *RepoNode) GetPath(dataFields []string) []*Item {
return path
}
// ToItem convert a re po node to a simple repo item
// ToItem convert a repo node to a simple repo item
func (node *RepoNode) ToItem(dataFields []string) *Item {
item := NewItem()
item.ID = node.ID
@ -88,6 +88,7 @@ func (node *RepoNode) ToItem(dataFields []string) *Item {
item.MimeType = node.MimeType
item.Hidden = node.Hidden
item.URI = node.URI
item.Groups = node.Groups
if dataFields == nil {
item.Data = node.Data
} else {