Skip to content

Commit

Permalink
Merge pull request #3 from ButterCMS/generic-contentfieldresponse-data
Browse files Browse the repository at this point in the history
Support generic data in ContentFieldsAPIResponse
  • Loading branch information
jakelumetta authored May 7, 2021
2 parents caec156 + fbe574b commit a8c2d5f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ package main
import (
"github.com/buttercms/buttercms-go"
"fmt"
"encoding/json"
)

func main() {
Expand Down Expand Up @@ -112,6 +113,20 @@ func main() {
}
}
}

contentParams := map[string]string{}
contentKeys := []string{"somethings"}
contentResp, err := ButterCMS.GetContentFields(contentKeys, contentParams)
if err != nil {
panic(err.Error())
}

j, err := json.Marshal(contentResp)
if err != nil {
fmt.Println(err)
}

fmt.Println(string(j))
}
```

Expand Down
2 changes: 1 addition & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ type FeedAPIResponse struct {

// Content Fields
type ContentFieldsAPIResponse struct {
Data map[string]string `json:"data"`
Data map[string]interface{} `json:"data"`
}

0 comments on commit a8c2d5f

Please sign in to comment.