diff options
author | 6543 <6543@obermui.de> | 2020-12-15 18:38:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-15 19:38:10 +0100 |
commit | e2aa7018128bc00c079820174baced9c8d6908c1 (patch) | |
tree | 5f2d3e3d195f8a0597c02ab0e0ba352583980eed /routers | |
parent | 980b0df8296cdec3692482c3efdbfa68036a1114 (diff) | |
download | gitea-e2aa7018128bc00c079820174baced9c8d6908c1.tar.gz gitea-e2aa7018128bc00c079820174baced9c8d6908c1.zip |
[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
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/repo/issue.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index c58e0bb6ce..25153ad507 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -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 { |