ensure that the `closed_at` is set for closed (#5449)

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:
which has no information about the closing date. (which exists in the
db and ui)
with this PR the result changes to this:


fixes: https://github.com/go-gitea/gitea/issues/5446
Signed-off-by: Roman <romaaan.git@gmail.com>
romankl 2018-12-02 21:43:01 +01:00 committed by techknowlogick
parent ce4885f761
commit 2d707fe5e6
1 changed files with 4 additions and 0 deletions

View File

@ -329,6 +329,10 @@ func (issue *Issue) APIFormat() *api.Issue {
Updated: issue.UpdatedUnix.AsTime(),
if issue.ClosedUnix != 0 {
apiIssue.Closed = issue.ClosedUnix.AsTimePtr()
if issue.Milestone != nil {
apiIssue.Milestone = issue.Milestone.APIFormat()