Skip to content

Commit d561946

Browse files
committed
change CommentReactionList from type to struct
1 parent e41f843 commit d561946

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

models/issue_reaction.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,5 +274,5 @@ func (list ReactionList) APIFormat() api.CommentReactionList {
274274
Count: counts[k],
275275
})
276276
}
277-
return result
277+
return api.CommentReactionList{CommentReactions: result}
278278
}

modules/structs/issue_comment.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,6 @@ type CommentReaction struct {
4646
}
4747

4848
// CommentReactionList is a list of comment reactions
49-
type CommentReactionList []*CommentReaction
49+
type CommentReactionList struct {
50+
CommentReactions []*CommentReaction `json:"comment_reactions" binding:"Required"`
51+
}

templates/swagger/v1_json.tmpl

+9-3
Original file line numberDiff line numberDiff line change
@@ -7807,9 +7807,15 @@
78077807
},
78087808
"CommentReactionList": {
78097809
"description": "CommentReactionList is a list of comment reactions",
7810-
"type": "array",
7811-
"items": {
7812-
"$ref": "#/definitions/CommentReaction"
7810+
"type": "object",
7811+
"properties": {
7812+
"comment_reactions": {
7813+
"type": "array",
7814+
"items": {
7815+
"$ref": "#/definitions/CommentReaction"
7816+
},
7817+
"x-go-name": "CommentReactions"
7818+
}
78137819
},
78147820
"x-go-package": "code.gitea.io/gitea/modules/structs"
78157821
},

0 commit comments

Comments
 (0)