1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Fix close issue but time watcher still running (#17761)

* Fix bug

* Update models/issue_stopwatch.go

Co-authored-by: zeripath <art27@cantab.net>

Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
Lunny Xiao
2021-11-23 20:05:44 +08:00
committed by GitHub
parent a08856606e
commit 714ecd9f1e
6 changed files with 153 additions and 96 deletions

View File

@@ -55,8 +55,8 @@ func StartIssueStopwatch(ctx *context.APIContext) {
return
}
if err := models.CreateOrStopIssueStopwatch(ctx.User, issue); err != nil {
ctx.Error(http.StatusInternalServerError, "CreateOrStopIssueStopwatch", err)
if err := models.CreateIssueStopwatch(ctx.User, issue); err != nil {
ctx.Error(http.StatusInternalServerError, "CreateIssueStopwatch", err)
return
}
@@ -104,8 +104,8 @@ func StopIssueStopwatch(ctx *context.APIContext) {
return
}
if err := models.CreateOrStopIssueStopwatch(ctx.User, issue); err != nil {
ctx.Error(http.StatusInternalServerError, "CreateOrStopIssueStopwatch", err)
if err := models.FinishIssueStopwatch(ctx.User, issue); err != nil {
ctx.Error(http.StatusInternalServerError, "FinishIssueStopwatch", err)
return
}