Skip to content

Commit 8e4a0a9

Browse files
romankltechknowlogick
authored andcommitted
ensure that the closed_at is set for closed (#5450)
right now the `closed_at` field for json responses is not filled during the `APIIssue` creation for api responses. For a closed issue you get a result like: ```json "state":"open","comments":0,"created_at":"2018-11-29T16:39:24+01:00", "updated_at":"2018-11-30T10:49:19+01:00","closed_at":null, "due_date":null,"pull_request":null} ``` which has no information about the closing date. (which exists in the db and ui) with this PR the result changes to this: ```json :null,"assignee":null,"assignees":null, "state":"closed", "comments":0,"created_at":"2018-11-29T16:43:05+01:00", "updated_at":"2018-12-02T19:17:05+01:00", "closed_at":"2018-12-02T19:17:05+01:00", "due_date":null,"pull_request":null} ``` fixes: #5446 Signed-off-by: Roman <[email protected]>
1 parent c1275e2 commit 8e4a0a9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

models/issue.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@ func (issue *Issue) APIFormat() *api.Issue {
325325
Updated: issue.UpdatedUnix.AsTime(),
326326
}
327327

328+
if issue.ClosedUnix != 0 {
329+
apiIssue.Closed = issue.ClosedUnix.AsTimePtr()
330+
}
331+
328332
if issue.Milestone != nil {
329333
apiIssue.Milestone = issue.Milestone.APIFormat()
330334
}

0 commit comments

Comments
 (0)