Skip to content

Commit 6c8ff32

Browse files
yardenshohamlunny
andauthored
Add updated_at field to PullReview API object (#21812)
* Closes #19997 Adds an `updated_at` time field to the `PullReview` API object to specify when the pull request review's state changed. Signed-off-by: Yarden Shoham <[email protected]> Co-authored-by: Lunny Xiao <[email protected]>
1 parent c772934 commit 6c8ff32

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

modules/convert/pull_review.go

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func ToPullReview(ctx context.Context, r *issues_model.Review, doer *user_model.
3939
Dismissed: r.Dismissed,
4040
CodeCommentsCount: r.GetCodeCommentsCount(),
4141
Submitted: r.CreatedUnix.AsTime(),
42+
Updated: r.UpdatedUnix.AsTime(),
4243
HTMLURL: r.HTMLURL(),
4344
HTMLPullURL: r.Issue.HTMLURL(),
4445
}

modules/structs/pull_review.go

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ type PullReview struct {
4040
CodeCommentsCount int `json:"comments_count"`
4141
// swagger:strfmt date-time
4242
Submitted time.Time `json:"submitted_at"`
43+
// swagger:strfmt date-time
44+
Updated time.Time `json:"updated_at"`
4345

4446
HTMLURL string `json:"html_url"`
4547
HTMLPullURL string `json:"pull_request_url"`

templates/swagger/v1_json.tmpl

+5
Original file line numberDiff line numberDiff line change
@@ -17891,6 +17891,11 @@
1789117891
"team": {
1789217892
"$ref": "#/definitions/Team"
1789317893
},
17894+
"updated_at": {
17895+
"type": "string",
17896+
"format": "date-time",
17897+
"x-go-name": "Updated"
17898+
},
1789417899
"user": {
1789517900
"$ref": "#/definitions/User"
1789617901
}

0 commit comments

Comments
 (0)