Merge pull request #29 from foomo/feature/add-groups-to-content-node

feat: add groups to the content.node.item response
This commit is contained in:
danielthomas74 2022-06-09 13:59:36 +02:00 committed by GitHub
commit 3a4a69e2cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {