diff options
author | Jochen Peters <no-go-nix@outlook.com> | 2020-09-05 13:58:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-05 12:58:33 +0100 |
commit | 385433d2f4522690ae01ff262e6c8952d88d75af (patch) | |
tree | 7e088323352588cb980322858d5417b6b05b3e8b /models/issue_stopwatch.go | |
parent | dba5d82f86dc9dc757404f03bf80ebbe28a5a0b1 (diff) | |
download | gitea-385433d2f4522690ae01ff262e6c8952d88d75af.tar.gz gitea-385433d2f4522690ae01ff262e6c8952d88d75af.zip |
additional data for type StopWatch in swagger api (#12458)
* additional data for type StopWatch in swagger api
* fix lint-backend issue with gofmt
* fix format in v1_json with 'make generate-swagger'
* using issue.LoadRepo() instead of getRepositoryByID()
Co-authored-by: jochen@homeland <no-go@localhost>
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'models/issue_stopwatch.go')
-rw-r--r-- | models/issue_stopwatch.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/models/issue_stopwatch.go b/models/issue_stopwatch.go index 79ce48c4cd..f80ce4139c 100644 --- a/models/issue_stopwatch.go +++ b/models/issue_stopwatch.go @@ -201,9 +201,15 @@ func (sw *Stopwatch) APIFormat() (api.StopWatch, error) { if err != nil { return api.StopWatch{}, err } + if err := issue.LoadRepo(); err != nil { + return api.StopWatch{}, err + } return api.StopWatch{ - Created: sw.CreatedUnix.AsTime(), - IssueIndex: issue.Index, + Created: sw.CreatedUnix.AsTime(), + IssueIndex: issue.Index, + IssueTitle: issue.Title, + RepoOwnerName: issue.Repo.OwnerName, + RepoName: issue.Repo.Name, }, nil } |