Skip to content

Commit 764da9f

Browse files
authored
Merge branch 'master' into api_fix-list-user-orgs
2 parents cf604f4 + b8c58ed commit 764da9f

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ David Svantesson <[email protected]> (@davidsvantesson)
3939
CirnoT <[email protected]> (@CirnoT)
4040
a1012112796 <[email protected]> (@a1012112796)
4141
Karl Heinz Marbaise <[email protected]> (@khmarbaise)
42+
Norwin Roosen <[email protected]> (@noerw)

modules/structs/issue.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ type Issue struct {
5050
Ref string `json:"ref"`
5151
Labels []*Label `json:"labels"`
5252
Milestone *Milestone `json:"milestone"`
53-
Assignee *User `json:"assignee"`
54-
Assignees []*User `json:"assignees"`
53+
// deprecated
54+
Assignee *User `json:"assignee"`
55+
Assignees []*User `json:"assignees"`
5556
// Whether the issue is open or closed
5657
//
5758
// type: string
@@ -83,7 +84,8 @@ type CreateIssueOption struct {
8384
// required:true
8485
Title string `json:"title" binding:"Required"`
8586
Body string `json:"body"`
86-
// username of assignee
87+
Ref string `json:"ref"`
88+
// deprecated
8789
Assignee string `json:"assignee"`
8890
Assignees []string `json:"assignees"`
8991
// swagger:strfmt date-time
@@ -97,8 +99,10 @@ type CreateIssueOption struct {
9799

98100
// EditIssueOption options for editing an issue
99101
type EditIssueOption struct {
100-
Title string `json:"title"`
101-
Body *string `json:"body"`
102+
Title string `json:"title"`
103+
Body *string `json:"body"`
104+
Ref *string `json:"ref"`
105+
// deprecated
102106
Assignee *string `json:"assignee"`
103107
Assignees []string `json:"assignees"`
104108
Milestone *int64 `json:"milestone"`

routers/api/v1/repo/issue.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ func CreateIssue(ctx *context.APIContext, form api.CreateIssueOption) {
486486
PosterID: ctx.User.ID,
487487
Poster: ctx.User,
488488
Content: form.Body,
489+
Ref: form.Ref,
489490
DeadlineUnix: deadlineUnix,
490491
}
491492

@@ -625,6 +626,13 @@ func EditIssue(ctx *context.APIContext, form api.EditIssueOption) {
625626
if form.Body != nil {
626627
issue.Content = *form.Body
627628
}
629+
if form.Ref != nil {
630+
err = issue_service.ChangeIssueRef(issue, ctx.User, *form.Ref)
631+
if err != nil {
632+
ctx.Error(http.StatusInternalServerError, "UpdateRef", err)
633+
return
634+
}
635+
}
628636

629637
// Update or remove the deadline, only if set and allowed
630638
if (form.Deadline != nil || form.RemoveDeadline != nil) && canWrite {

templates/swagger/v1_json.tmpl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11937,7 +11937,7 @@
1193711937
],
1193811938
"properties": {
1193911939
"assignee": {
11940-
"description": "username of assignee",
11940+
"description": "deprecated",
1194111941
"type": "string",
1194211942
"x-go-name": "Assignee"
1194311943
},
@@ -11976,6 +11976,10 @@
1197611976
"format": "int64",
1197711977
"x-go-name": "Milestone"
1197811978
},
11979+
"ref": {
11980+
"type": "string",
11981+
"x-go-name": "Ref"
11982+
},
1197911983
"title": {
1198011984
"type": "string",
1198111985
"x-go-name": "Title"
@@ -12778,6 +12782,7 @@
1277812782
"type": "object",
1277912783
"properties": {
1278012784
"assignee": {
12785+
"description": "deprecated",
1278112786
"type": "string",
1278212787
"x-go-name": "Assignee"
1278312788
},
@@ -12802,6 +12807,10 @@
1280212807
"format": "int64",
1280312808
"x-go-name": "Milestone"
1280412809
},
12810+
"ref": {
12811+
"type": "string",
12812+
"x-go-name": "Ref"
12813+
},
1280512814
"state": {
1280612815
"type": "string",
1280712816
"x-go-name": "State"

0 commit comments

Comments
 (0)