Add create_at and updated_at in PR json (#1616)

* Move new fields to object creation (use reference)
 * Vendor: Update SDK
This commit is contained in:
Jonas Östanbäck 2017-04-27 11:29:46 +02:00 committed by Lunny Xiao
parent 8371f94d06
commit e4a0a04829
4 changed files with 9 additions and 4 deletions

View File

@ -197,6 +197,8 @@ func (pr *PullRequest) APIFormat() *api.PullRequest {
Base: apiBaseBranchInfo, Base: apiBaseBranchInfo,
Head: apiHeadBranchInfo, Head: apiHeadBranchInfo,
MergeBase: pr.MergeBase, MergeBase: pr.MergeBase,
Created: &pr.Issue.Created,
Updated: &pr.Issue.Updated,
} }
if pr.Status != PullRequestStatusChecking { if pr.Status != PullRequestStatusChecking {

View File

@ -38,6 +38,9 @@ type PullRequest struct {
Base *PRBranchInfo `json:"base"` Base *PRBranchInfo `json:"base"`
Head *PRBranchInfo `json:"head"` Head *PRBranchInfo `json:"head"`
MergeBase string `json:"merge_base"` MergeBase string `json:"merge_base"`
Created *time.Time `json:"created_at"`
Updated *time.Time `json:"updated_at"`
} }
// PRBranchInfo base branch info when send a PR // PRBranchInfo base branch info when send a PR

View File

@ -14,7 +14,7 @@ import (
// Release represents a repository release // Release represents a repository release
type Release struct { type Release struct {
ID int64 `json:"id"` ID int64 `json:"id"`
TagName string `json:"name"` TagName string `json:"tag_name"`
Target string `json:"target_commitish"` Target string `json:"target_commitish"`
Title string `json:"name"` Title string `json:"name"`
Note string `json:"body"` Note string `json:"body"`

6
vendor/vendor.json vendored
View File

@ -9,10 +9,10 @@
"revisionTime": "2017-04-07T07:44:04Z" "revisionTime": "2017-04-07T07:44:04Z"
}, },
{ {
"checksumSHA1": "7/pZpgSIh/M76hwvldhgRqege/Q=", "checksumSHA1": "xACJysFK1sK/D5655EpU48mw2vo=",
"path": "code.gitea.io/sdk/gitea", "path": "code.gitea.io/sdk/gitea",
"revision": "cad003b49151391f9a22f2e2edb2f348f51f9dde", "revision": "0c3a0b0b5ea6edfb5bf3a4c81ebda6d207ecdfad",
"revisionTime": "2017-04-15T14:32:48Z" "revisionTime": "2017-04-27T00:40:26Z"
}, },
{ {
"checksumSHA1": "IyfS7Rbl6OgR83QR7TOfKdDCq+M=", "checksumSHA1": "IyfS7Rbl6OgR83QR7TOfKdDCq+M=",