From 62a3f21b5ab64758f943d9b0148b51c0debb8ae2 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Mon, 14 Nov 2022 21:02:29 +0000 Subject: [PATCH 1/2] Add `updated_at` field to PullReview object Signed-off-by: Yarden Shoham --- modules/convert/pull_review.go | 1 + modules/structs/pull_review.go | 2 ++ templates/swagger/v1_json.tmpl | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/modules/convert/pull_review.go b/modules/convert/pull_review.go index 93ce208224f8f..e8a543fea955a 100644 --- a/modules/convert/pull_review.go +++ b/modules/convert/pull_review.go @@ -39,6 +39,7 @@ func ToPullReview(ctx context.Context, r *issues_model.Review, doer *user_model. Dismissed: r.Dismissed, CodeCommentsCount: r.GetCodeCommentsCount(), Submitted: r.CreatedUnix.AsTime(), + Updated: r.UpdatedUnix.AsTime(), HTMLURL: r.HTMLURL(), HTMLPullURL: r.Issue.HTMLURL(), } diff --git a/modules/structs/pull_review.go b/modules/structs/pull_review.go index 7c9360a0c2200..ca2af48657365 100644 --- a/modules/structs/pull_review.go +++ b/modules/structs/pull_review.go @@ -40,6 +40,8 @@ type PullReview struct { CodeCommentsCount int `json:"comments_count"` // swagger:strfmt date-time Submitted time.Time `json:"submitted_at"` + // swagger:strfmt date-time + Updated time.Time `json:"updated_at"` HTMLURL string `json:"html_url"` HTMLPullURL string `json:"pull_request_url"` diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 229e219064192..4e94385dce1de 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -17888,6 +17888,11 @@ "format": "date-time", "x-go-name": "Submitted" }, + "updated_at": { + "type": "string", + "format": "date-time", + "x-go-name": "Updated" + }, "team": { "$ref": "#/definitions/Team" }, From 614ba9f3392289821752d51d3ba00392210acdf1 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Mon, 14 Nov 2022 21:12:03 +0000 Subject: [PATCH 2/2] Fix swagger docs --- templates/swagger/v1_json.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 4e94385dce1de..fe3185ea77ea4 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -17888,14 +17888,14 @@ "format": "date-time", "x-go-name": "Submitted" }, + "team": { + "$ref": "#/definitions/Team" + }, "updated_at": { "type": "string", "format": "date-time", "x-go-name": "Updated" }, - "team": { - "$ref": "#/definitions/Team" - }, "user": { "$ref": "#/definitions/User" }