mirror of
https://github.com/go-gitea/gitea
synced 2026-02-03 11:10:40 +00:00
Add resolve/unresolve review comment API endpoints (#36441)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -1034,6 +1034,20 @@ func GetCommentByID(ctx context.Context, id int64) (*Comment, error) {
|
||||
return c, nil
|
||||
}
|
||||
|
||||
func GetCommentWithRepoID(ctx context.Context, repoID, commentID int64) (*Comment, error) {
|
||||
c, err := GetCommentByID(ctx, commentID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := c.LoadIssue(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if c.Issue.RepoID != repoID {
|
||||
return nil, ErrCommentNotExist{commentID, 0}
|
||||
}
|
||||
return c, nil
|
||||
}
|
||||
|
||||
// FindCommentsOptions describes the conditions to Find comments
|
||||
type FindCommentsOptions struct {
|
||||
db.ListOptions
|
||||
|
||||
@@ -102,6 +102,7 @@ func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issu
|
||||
continue
|
||||
}
|
||||
comment.Review = re
|
||||
comment.Issue = issue
|
||||
}
|
||||
comments[n] = comment
|
||||
n++
|
||||
|
||||
Reference in New Issue
Block a user