Browse Source

PR Webhook - Add base/head info (#3547)

* messing with getting local go-gogs-client

* coding style fix

* added comments for required fields
pull/3740/merge
Kurt Madel 8 years ago committed by 无闻
parent
commit
3b0e2c1c3f
  1. 6
      models/pull.go

6
models/pull.go

@ -113,6 +113,8 @@ func (pr *PullRequest) LoadIssue() (err error) {
// This method assumes following fields have been assigned with valid values:
// Required - Issue
// Required - HeadRepo
// Required - BaseRepo
// Optional - Merger
func (pr *PullRequest) APIFormat() *api.PullRequest {
apiIssue := pr.Issue.APIFormat()
@ -127,6 +129,10 @@ func (pr *PullRequest) APIFormat() *api.PullRequest {
Assignee: apiIssue.Assignee,
State: apiIssue.State,
Comments: apiIssue.Comments,
HeadBranch: pr.HeadBranch,
HeadRepo: pr.HeadRepo.APIFormat(nil),
BaseBranch: pr.BaseBranch,
BaseRepo: pr.BaseRepo.APIFormat(nil),
HTMLURL: pr.Issue.HTMLURL(),
HasMerged: pr.HasMerged,
}

Loading…
Cancel
Save