From cac32f2d528246d32d929bcb6878bba69ba97178 Mon Sep 17 00:00:00 2001 From: Daniel Thomas Date: Thu, 9 Jun 2022 11:54:46 +0200 Subject: [PATCH] feat: add groups to the content.node.item response --- content/item.go | 1 + content/reponode.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/content/item.go b/content/item.go index ec8c8fa..d54e660 100644 --- a/content/item.go +++ b/content/item.go @@ -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 diff --git a/content/reponode.go b/content/reponode.go index e7a3bd9..b5cf917 100644 --- a/content/reponode.go +++ b/content/reponode.go @@ -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 {