diff options
Diffstat (limited to 'routers/api/v1/repo/issue.go')
-rw-r--r-- | routers/api/v1/repo/issue.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index 8c9336ba9c..a80adbc356 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -57,7 +57,6 @@ func CreateIssue(ctx *context.APIContext, form api.CreateIssueOption) { PosterID: ctx.User.Id, Poster: ctx.User, Content: form.Body, - IsClosed: form.Closed, } if ctx.Repo.IsWriter() { @@ -86,6 +85,13 @@ func CreateIssue(ctx *context.APIContext, form api.CreateIssueOption) { return } + if form.Closed { + if err := issue.ChangeStatus(ctx.User, ctx.Repo.Repository, true); err != nil { + ctx.Error(500, "issue.ChangeStatus", err) + return + } + } + // Refetch from database to assign some automatic values var err error issue, err = models.GetIssueByID(issue.ID) |