1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-05-11 05:55:29 +00:00

Simplified create and find functions for review

Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
Jonas Franz
2018-05-10 20:41:31 +02:00
parent 9544c46052
commit 0f772d1bf4
3 changed files with 95 additions and 43 deletions

View File

@ -360,6 +360,7 @@ func createComment(e *xorm.Session, opts *CreateCommentOptions) (_ *Comment, err
OldTitle: opts.OldTitle,
NewTitle: opts.NewTitle,
TreePath: opts.TreePath,
ReviewID: opts.ReviewID,
}
if _, err = e.Insert(comment); err != nil {
return nil, err
@ -579,6 +580,7 @@ type CreateCommentOptions struct {
CommitSHA string
LineNum int64
TreePath string
ReviewID int64
Content string
Attachments []string // UUIDs of attachments
}
@ -619,7 +621,7 @@ func CreateIssueComment(doer *User, repo *Repository, issue *Issue, content stri
}
// CreateCodeComment creates a plain code comment at the specified line / path
func CreateCodeComment(doer *User, repo *Repository, issue *Issue, commitSHA, content, treePath string, line int64) (*Comment, error) {
func CreateCodeComment(doer *User, repo *Repository, issue *Issue, commitSHA, content, treePath string, line, reviewID int64) (*Comment, error) {
return CreateComment(&CreateCommentOptions{
Type: CommentTypeCode,
Doer: doer,
@ -629,6 +631,7 @@ func CreateCodeComment(doer *User, repo *Repository, issue *Issue, commitSHA, co
LineNum: line,
TreePath: treePath,
CommitSHA: commitSHA,
ReviewID: reviewID,
})
}