* 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
1 changed files with 6 additions and 0 deletions
|
@ -161,6 +161,12 @@ func EditIssue(ctx *context.APIContext, form api.EditIssueOption) {
|
||||||
ctx.Error(500, "UpdateIssue", err)
|
ctx.Error(500, "UpdateIssue", err)
|
||||||
return
|
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
|
// Refetch from database to assign some automatic values
|
||||||
issue, err = models.GetIssueByID(issue.ID)
|
issue, err = models.GetIssueByID(issue.ID)
|
||||||
|
|
Loading…
Reference in a new issue