Skip to content

Commit

Permalink
change CommentReactionList from type to struct
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Nov 5, 2019
1 parent e41f843 commit d561946
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion models/issue_reaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,5 +274,5 @@ func (list ReactionList) APIFormat() api.CommentReactionList {
Count: counts[k],
})
}
return result
return api.CommentReactionList{CommentReactions: result}
}
4 changes: 3 additions & 1 deletion modules/structs/issue_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ type CommentReaction struct {
}

// CommentReactionList is a list of comment reactions
type CommentReactionList []*CommentReaction
type CommentReactionList struct {
CommentReactions []*CommentReaction `json:"comment_reactions" binding:"Required"`
}
12 changes: 9 additions & 3 deletions templates/swagger/v1_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7807,9 +7807,15 @@
},
"CommentReactionList": {
"description": "CommentReactionList is a list of comment reactions",
"type": "array",
"items": {
"$ref": "#/definitions/CommentReaction"
"type": "object",
"properties": {
"comment_reactions": {
"type": "array",
"items": {
"$ref": "#/definitions/CommentReaction"
},
"x-go-name": "CommentReactions"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
Expand Down

0 comments on commit d561946

Please sign in to comment.