]> source.dussan.org Git - gitea.git/commit
ensure that the `closed_at` is set for closed (#5450)
authorromankl <romankl@users.noreply.github.com>
Sun, 2 Dec 2018 22:50:47 +0000 (23:50 +0100)
committertechknowlogick <hello@techknowlogick.com>
Sun, 2 Dec 2018 22:50:47 +0000 (17:50 -0500)
commit8e4a0a978a30155e16d533275f071848e2527bfb
tree61dc24f30b6a7e8a682af4def6f22e7877d103cb
parentc1275e2ba62449ac55f545aacb03edf13d02fd72
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: https://github.com/go-gitea/gitea/issues/5446
Signed-off-by: Roman <romaaan.git@gmail.com>
models/issue.go