[API] Add ref to create/edit issue options & deprecated assignee (#13992)

* API: Add ref to create/edit issue options

* deprecate Assignee in favour of Assignees
This commit is contained in:
6543 2020-12-15 18:38:10 +00:00 committed by GitHub
parent 980b0df829
commit e2aa701812
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 6 deletions

View file

@ -486,6 +486,7 @@ func CreateIssue(ctx *context.APIContext, form api.CreateIssueOption) {
PosterID: ctx.User.ID,
Poster: ctx.User,
Content: form.Body,
Ref: form.Ref,
DeadlineUnix: deadlineUnix,
}
@ -625,6 +626,13 @@ func EditIssue(ctx *context.APIContext, form api.EditIssueOption) {
if form.Body != nil {
issue.Content = *form.Body
}
if form.Ref != nil {
err = issue_service.ChangeIssueRef(issue, ctx.User, *form.Ref)
if err != nil {
ctx.Error(http.StatusInternalServerError, "UpdateRef", err)
return
}
}
// Update or remove the deadline, only if set and allowed
if (form.Deadline != nil || form.RemoveDeadline != nil) && canWrite {