aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-06-01 23:01:55 +0200
committerGitHub <noreply@github.com>2020-06-01 22:01:55 +0100
commitdc812f8ba5bf1c123fa948afed15c4309da8fb45 (patch)
tree1914fdf619626ae161a618e58e9cd80b38312c36 /modules
parent7cb1e1f609d485811a34a1ed54cec78ec01ceaa4 (diff)
downloadgitea-dc812f8ba5bf1c123fa948afed15c4309da8fb45.tar.gz
gitea-dc812f8ba5bf1c123fa948afed15c4309da8fb45.zip
Issue/Pull expose IsLocked Property on API (#11708)
Expose IsLocked Property
Diffstat (limited to 'modules')
-rw-r--r--modules/convert/issue.go1
-rw-r--r--modules/convert/pull.go1
-rw-r--r--modules/structs/issue.go1
-rw-r--r--modules/structs/pull.go1
4 files changed, 4 insertions, 0 deletions
diff --git a/modules/convert/issue.go b/modules/convert/issue.go
index ab1f9f1e63..a335f6326b 100644
--- a/modules/convert/issue.go
+++ b/modules/convert/issue.go
@@ -36,6 +36,7 @@ func ToAPIIssue(issue *models.Issue) *api.Issue {
Body: issue.Content,
Labels: ToLabelList(issue.Labels),
State: issue.State(),
+ IsLocked: issue.IsLocked,
Comments: issue.NumComments,
Created: issue.CreatedUnix.AsTime(),
Updated: issue.UpdatedUnix.AsTime(),
diff --git a/modules/convert/pull.go b/modules/convert/pull.go
index 6ff88c4d8a..2fa22efcb3 100644
--- a/modules/convert/pull.go
+++ b/modules/convert/pull.go
@@ -53,6 +53,7 @@ func ToAPIPullRequest(pr *models.PullRequest) *api.PullRequest {
Assignee: apiIssue.Assignee,
Assignees: apiIssue.Assignees,
State: apiIssue.State,
+ IsLocked: apiIssue.IsLocked,
Comments: apiIssue.Comments,
HTMLURL: pr.Issue.HTMLURL(),
DiffURL: pr.Issue.DiffURL(),
diff --git a/modules/structs/issue.go b/modules/structs/issue.go
index eed5bb500b..dc633dedce 100644
--- a/modules/structs/issue.go
+++ b/modules/structs/issue.go
@@ -55,6 +55,7 @@ type Issue struct {
// type: string
// enum: open,closed
State StateType `json:"state"`
+ IsLocked bool `json:"is_locked"`
Comments int `json:"comments"`
// swagger:strfmt date-time
Created time.Time `json:"created_at"`
diff --git a/modules/structs/pull.go b/modules/structs/pull.go
index c4ec7d416a..8dea51f2c6 100644
--- a/modules/structs/pull.go
+++ b/modules/structs/pull.go
@@ -21,6 +21,7 @@ type PullRequest struct {
Assignee *User `json:"assignee"`
Assignees []*User `json:"assignees"`
State StateType `json:"state"`
+ IsLocked bool `json:"is_locked"`
Comments int `json:"comments"`
HTMLURL string `json:"html_url"`