[API] Add Ref to Issue (#13946)
* Add Ref to api.Issue This PR adds Ref to api.Issue and adds the backend parts to the migrator. Fix #13918 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
cf6f8b22ca
commit
825efa2605
|
@ -34,6 +34,7 @@ func ToAPIIssue(issue *models.Issue) *api.Issue {
|
||||||
Poster: ToUser(issue.Poster, false, false),
|
Poster: ToUser(issue.Poster, false, false),
|
||||||
Title: issue.Title,
|
Title: issue.Title,
|
||||||
Body: issue.Content,
|
Body: issue.Content,
|
||||||
|
Ref: issue.Ref,
|
||||||
Labels: ToLabelList(issue.Labels),
|
Labels: ToLabelList(issue.Labels),
|
||||||
State: issue.State(),
|
State: issue.State(),
|
||||||
IsLocked: issue.IsLocked,
|
IsLocked: issue.IsLocked,
|
||||||
|
|
|
@ -15,6 +15,7 @@ type Issue struct {
|
||||||
PosterEmail string
|
PosterEmail string
|
||||||
Title string
|
Title string
|
||||||
Content string
|
Content string
|
||||||
|
Ref string
|
||||||
Milestone string
|
Milestone string
|
||||||
State string // closed, open
|
State string // closed, open
|
||||||
IsLocked bool
|
IsLocked bool
|
||||||
|
|
|
@ -333,6 +333,7 @@ func (g *GiteaLocalUploader) CreateIssues(issues ...*base.Issue) error {
|
||||||
Index: issue.Number,
|
Index: issue.Number,
|
||||||
Title: issue.Title,
|
Title: issue.Title,
|
||||||
Content: issue.Content,
|
Content: issue.Content,
|
||||||
|
Ref: issue.Ref,
|
||||||
IsClosed: issue.State == "closed",
|
IsClosed: issue.State == "closed",
|
||||||
IsLocked: issue.IsLocked,
|
IsLocked: issue.IsLocked,
|
||||||
MilestoneID: milestoneID,
|
MilestoneID: milestoneID,
|
||||||
|
|
|
@ -47,6 +47,7 @@ type Issue struct {
|
||||||
OriginalAuthorID int64 `json:"original_author_id"`
|
OriginalAuthorID int64 `json:"original_author_id"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Body string `json:"body"`
|
Body string `json:"body"`
|
||||||
|
Ref string `json:"ref"`
|
||||||
Labels []*Label `json:"labels"`
|
Labels []*Label `json:"labels"`
|
||||||
Milestone *Milestone `json:"milestone"`
|
Milestone *Milestone `json:"milestone"`
|
||||||
Assignee *User `json:"assignee"`
|
Assignee *User `json:"assignee"`
|
||||||
|
|
|
@ -13831,6 +13831,10 @@
|
||||||
"pull_request": {
|
"pull_request": {
|
||||||
"$ref": "#/definitions/PullRequestMeta"
|
"$ref": "#/definitions/PullRequestMeta"
|
||||||
},
|
},
|
||||||
|
"ref": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Ref"
|
||||||
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"$ref": "#/definitions/RepositoryMeta"
|
"$ref": "#/definitions/RepositoryMeta"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue