EntityAPI: Include folder support and watch API stubs (#61338)

This commit is contained in:
Ryan McKinley
2023-01-13 00:39:36 +00:00
committed by GitHub
parent da3f02d81b
commit 0c20fe0ac9
10 changed files with 996 additions and 346 deletions
@@ -11,7 +11,6 @@ type summarySupport struct {
name string
description *string // null or empty
slug *string // null or empty
folder *string // null or empty
labels *string
fields *string
errors *string // should not allow saving with this!
@@ -37,9 +36,6 @@ func newSummarySupport(summary *models.EntitySummary) (*summarySupport, error) {
if summary.Slug != "" {
s.slug = &summary.Slug
}
if summary.Folder != "" {
s.folder = &summary.Folder
}
if len(summary.Labels) > 0 {
js, err = json.Marshal(summary.Labels)
if err != nil {
@@ -81,9 +77,6 @@ func (s summarySupport) toEntitySummary() (*models.EntitySummary, error) {
if s.slug != nil {
summary.Slug = *s.slug
}
if s.folder != nil {
summary.Folder = *s.folder
}
if s.labels != nil {
b := []byte(*s.labels)
err = json.Unmarshal(b, &summary.Labels)