From e4a0a04829fc337ca9d0adcacda159fd6021e5de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=96stanb=C3=A4ck?= Date: Thu, 27 Apr 2017 11:29:46 +0200 Subject: [PATCH] Add create_at and updated_at in PR json (#1616) * Move new fields to object creation (use reference) * Vendor: Update SDK --- models/pull.go | 2 ++ vendor/code.gitea.io/sdk/gitea/pull.go | 3 +++ vendor/code.gitea.io/sdk/gitea/release.go | 2 +- vendor/vendor.json | 6 +++--- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/models/pull.go b/models/pull.go index ababe79dd4..07c58446da 100644 --- a/models/pull.go +++ b/models/pull.go @@ -197,6 +197,8 @@ func (pr *PullRequest) APIFormat() *api.PullRequest { Base: apiBaseBranchInfo, Head: apiHeadBranchInfo, MergeBase: pr.MergeBase, + Created: &pr.Issue.Created, + Updated: &pr.Issue.Updated, } if pr.Status != PullRequestStatusChecking { diff --git a/vendor/code.gitea.io/sdk/gitea/pull.go b/vendor/code.gitea.io/sdk/gitea/pull.go index fcccf07e2b..a50db96e3e 100644 --- a/vendor/code.gitea.io/sdk/gitea/pull.go +++ b/vendor/code.gitea.io/sdk/gitea/pull.go @@ -38,6 +38,9 @@ type PullRequest struct { Base *PRBranchInfo `json:"base"` Head *PRBranchInfo `json:"head"` 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 diff --git a/vendor/code.gitea.io/sdk/gitea/release.go b/vendor/code.gitea.io/sdk/gitea/release.go index de5ccba342..cc841466d8 100644 --- a/vendor/code.gitea.io/sdk/gitea/release.go +++ b/vendor/code.gitea.io/sdk/gitea/release.go @@ -14,7 +14,7 @@ import ( // Release represents a repository release type Release struct { ID int64 `json:"id"` - TagName string `json:"name"` + TagName string `json:"tag_name"` Target string `json:"target_commitish"` Title string `json:"name"` Note string `json:"body"` diff --git a/vendor/vendor.json b/vendor/vendor.json index edc3fbf391..08909a8c17 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -9,10 +9,10 @@ "revisionTime": "2017-04-07T07:44:04Z" }, { - "checksumSHA1": "7/pZpgSIh/M76hwvldhgRqege/Q=", + "checksumSHA1": "xACJysFK1sK/D5655EpU48mw2vo=", "path": "code.gitea.io/sdk/gitea", - "revision": "cad003b49151391f9a22f2e2edb2f348f51f9dde", - "revisionTime": "2017-04-15T14:32:48Z" + "revision": "0c3a0b0b5ea6edfb5bf3a4c81ebda6d207ecdfad", + "revisionTime": "2017-04-27T00:40:26Z" }, { "checksumSHA1": "IyfS7Rbl6OgR83QR7TOfKdDCq+M=",