mirror of
https://github.com/foomo/contentserver.git
synced 2025-10-16 12:25:44 +00:00
feat: add groups to the content.node.item response
This commit is contained in:
parent
f3366f5211
commit
cac32f2d52
@ -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
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user