mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-28 23:36:29 +01:00
* 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)
|
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 New Issue
Block a user