Skip to content

Commit 90c5d43

Browse files
committed
Fix test
1 parent d506655 commit 90c5d43

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

routers/api/v1/repo/issue_stopwatch.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"net/http"
1010

1111
"code.gitea.io/gitea/models"
12+
"code.gitea.io/gitea/models/db"
1213
"code.gitea.io/gitea/modules/context"
1314
"code.gitea.io/gitea/modules/convert"
1415
"code.gitea.io/gitea/routers/api/v1/utils"
@@ -55,7 +56,7 @@ func StartIssueStopwatch(ctx *context.APIContext) {
5556
return
5657
}
5758

58-
if err := models.CreateOrStopIssueStopwatch(ctx.User, issue); err != nil {
59+
if err := models.CreateIssueStopwatch(db.DefaultContext, ctx.User, issue); err != nil {
5960
ctx.Error(http.StatusInternalServerError, "CreateOrStopIssueStopwatch", err)
6061
return
6162
}
@@ -104,7 +105,7 @@ func StopIssueStopwatch(ctx *context.APIContext) {
104105
return
105106
}
106107

107-
if err := models.CreateOrStopIssueStopwatch(ctx.User, issue); err != nil {
108+
if err := models.FinishIssueStopwatch(db.DefaultContext, ctx.User, issue); err != nil {
108109
ctx.Error(http.StatusInternalServerError, "CreateOrStopIssueStopwatch", err)
109110
return
110111
}

0 commit comments

Comments
 (0)