Skip to content

Commit

Permalink
Add updated_at field to PullReview API object (go-gitea#21812)
Browse files Browse the repository at this point in the history
* Closes go-gitea#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 <hrsi88@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
2 people authored and fsologureng committed Nov 22, 2022
1 parent 959e64e commit 4cf8c4c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/convert/pull_review.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
Expand Down
2 changes: 2 additions & 0 deletions modules/structs/pull_review.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
5 changes: 5 additions & 0 deletions templates/swagger/v1_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17891,6 +17891,11 @@
"team": {
"$ref": "#/definitions/Team"
},
"updated_at": {
"type": "string",
"format": "date-time",
"x-go-name": "Updated"
},
"user": {
"$ref": "#/definitions/User"
}
Expand Down

0 comments on commit 4cf8c4c

Please sign in to comment.