forked from Gitlink/gitea-1156
* Issues can be closed via API * Error-checking is nice xD * EditIssueOption.Status => State * Use const instead of string-literal
This commit is contained in:
parent
7f7216be6e
commit
7c5710d31f
|
@ -161,6 +161,12 @@ func EditIssue(ctx *context.APIContext, form api.EditIssueOption) {
|
|||
ctx.Error(500, "UpdateIssue", err)
|
||||
return
|
||||
}
|
||||
if form.State != nil {
|
||||
if err = issue.ChangeStatus(ctx.User, ctx.Repo.Repository, api.STATE_CLOSED == api.StateType(*form.State)); err != nil {
|
||||
ctx.Error(500, "ChangeStatus", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Refetch from database to assign some automatic values
|
||||
issue, err = models.GetIssueByID(issue.ID)
|
||||
|
|
Loading…
Reference in New Issue