1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-03-26 20:53:55 +02:00

wip: interface{} in JSON marshal struct

This commit is contained in:
Paul Esch-Laurent 2022-12-05 16:10:03 -06:00
parent 88abeb89ee
commit dcdc3e20d9
2 changed files with 10 additions and 23 deletions

View File

@ -83,17 +83,10 @@ func (a *API) handleGetAllBoards(w http.ResponseWriter, r *http.Request) {
mlog.Int("boardsCount", len(boards)),
)
response := struct {
hasNext bool
results []*model.Board
}{
hasNext: hasNext,
results: boards,
response := model.ComplianceResponse{
HasNext: hasNext,
Results: boards,
}
// response := model.ComplianceResponse{
// HasNext: hasNext,
// Results: boards,
// }
data, err := json.Marshal(response)
if err != nil {
a.errorResponse(w, r, err)
@ -175,12 +168,9 @@ func (a *API) handleGetBoardsHistory(w http.ResponseWriter, r *http.Request) {
mlog.Int("boardsCount", len(boards)),
)
response := struct {
hasNext bool
results []*model.Board // ish
}{
hasNext: hasNext,
results: boards,
response := model.ComplianceResponse{
HasNext: hasNext,
Results: boards,
}
data, err := json.Marshal(response)
if err != nil {
@ -265,12 +255,9 @@ func (a *API) handleGetBlocksHistory(w http.ResponseWriter, r *http.Request) {
mlog.Int("blocksCount", len(blocks)),
)
response := struct {
hasNext bool
results []*model.Block // ish
}{
hasNext: hasNext,
results: blocks,
response := model.ComplianceResponse{
HasNext: hasNext,
Results: blocks,
}
data, err := json.Marshal(response)
if err != nil {

View File

@ -11,5 +11,5 @@ type ComplianceResponse struct {
// The array of results
// required: true
Results []interface{} `json:"results"`
Results interface{} `json:"results"`
}