Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions models/issues/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,9 @@ func (c *Comment) LoadReactions(ctx context.Context, repo *repo_model.Repository
}

func (c *Comment) loadReview(ctx context.Context) (err error) {
if c.ReviewID == 0 {
return nil
}
if c.Review == nil {
if c.Review, err = GetReviewByID(ctx, c.ReviewID); err != nil {
return err
Expand Down
3 changes: 3 additions & 0 deletions models/issues/comment_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ func (comments CommentList) loadReviews(ctx context.Context) error {
}

for _, comment := range comments {
if comment.Type == CommentTypeReviewRequest {
continue
}
comment.Review = reviews[comment.ReviewID]
if comment.Review == nil {
if comment.ReviewID > 0 {
Expand Down
3 changes: 3 additions & 0 deletions models/issues/review.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,9 @@ func AddReviewRequest(ctx context.Context, issue *Issue, reviewer, doer *user_mo
return nil, err
}

// func caller use the created comment to retrieve created review too.
comment.Review = review

return comment, committer.Commit()
}

Expand Down