[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:
parent
980b0df829
commit
e2aa701812
3 changed files with 27 additions and 6 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue