Skip to content

Commit dc812f8

Browse files
authored
Issue/Pull expose IsLocked Property on API (#11708)
Expose IsLocked Property
1 parent 7cb1e1f commit dc812f8

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

modules/convert/issue.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func ToAPIIssue(issue *models.Issue) *api.Issue {
3636
Body: issue.Content,
3737
Labels: ToLabelList(issue.Labels),
3838
State: issue.State(),
39+
IsLocked: issue.IsLocked,
3940
Comments: issue.NumComments,
4041
Created: issue.CreatedUnix.AsTime(),
4142
Updated: issue.UpdatedUnix.AsTime(),

modules/convert/pull.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func ToAPIPullRequest(pr *models.PullRequest) *api.PullRequest {
5353
Assignee: apiIssue.Assignee,
5454
Assignees: apiIssue.Assignees,
5555
State: apiIssue.State,
56+
IsLocked: apiIssue.IsLocked,
5657
Comments: apiIssue.Comments,
5758
HTMLURL: pr.Issue.HTMLURL(),
5859
DiffURL: pr.Issue.DiffURL(),

modules/structs/issue.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ type Issue struct {
5555
// type: string
5656
// enum: open,closed
5757
State StateType `json:"state"`
58+
IsLocked bool `json:"is_locked"`
5859
Comments int `json:"comments"`
5960
// swagger:strfmt date-time
6061
Created time.Time `json:"created_at"`

modules/structs/pull.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type PullRequest struct {
2121
Assignee *User `json:"assignee"`
2222
Assignees []*User `json:"assignees"`
2323
State StateType `json:"state"`
24+
IsLocked bool `json:"is_locked"`
2425
Comments int `json:"comments"`
2526

2627
HTMLURL string `json:"html_url"`

templates/swagger/v1_json.tmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12828,6 +12828,10 @@
1282812828
"format": "int64",
1282912829
"x-go-name": "ID"
1283012830
},
12831+
"is_locked": {
12832+
"type": "boolean",
12833+
"x-go-name": "IsLocked"
12834+
},
1283112835
"labels": {
1283212836
"type": "array",
1283312837
"items": {
@@ -13501,6 +13505,10 @@
1350113505
"format": "int64",
1350213506
"x-go-name": "ID"
1350313507
},
13508+
"is_locked": {
13509+
"type": "boolean",
13510+
"x-go-name": "IsLocked"
13511+
},
1350413512
"labels": {
1350513513
"type": "array",
1350613514
"items": {

0 commit comments

Comments
 (0)