Use CommentList instead of []*Comment (#24828)

As title.
This commit is contained in:
Lunny Xiao 2023-05-21 20:48:28 +08:00 committed by GitHub
parent edd8ea0b0d
commit 64f6a5d113
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 13 deletions

View file

@ -48,7 +48,7 @@ func fetchCodeCommentsByReview(ctx context.Context, issue *Issue, currentUser *u
}
func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issue, currentUser *user_model.User, review *Review) ([]*Comment, error) {
var comments []*Comment
var comments CommentList
if review == nil {
review = &Review{ID: 0}
}
@ -68,7 +68,7 @@ func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issu
return nil, err
}
if err := CommentList(comments).LoadPosters(ctx); err != nil {
if err := comments.LoadPosters(ctx); err != nil {
return nil, err
}