mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Issue/Pull expose IsLocked Property on API (#11708)
Expose IsLocked Property
This commit is contained in:
		@@ -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(),
 | 
			
		||||
 
 | 
			
		||||
@@ -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(),
 | 
			
		||||
 
 | 
			
		||||
@@ -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"`
 | 
			
		||||
 
 | 
			
		||||
@@ -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"`
 | 
			
		||||
 
 | 
			
		||||
@@ -12828,6 +12828,10 @@
 | 
			
		||||
          "format": "int64",
 | 
			
		||||
          "x-go-name": "ID"
 | 
			
		||||
        },
 | 
			
		||||
        "is_locked": {
 | 
			
		||||
          "type": "boolean",
 | 
			
		||||
          "x-go-name": "IsLocked"
 | 
			
		||||
        },
 | 
			
		||||
        "labels": {
 | 
			
		||||
          "type": "array",
 | 
			
		||||
          "items": {
 | 
			
		||||
@@ -13501,6 +13505,10 @@
 | 
			
		||||
          "format": "int64",
 | 
			
		||||
          "x-go-name": "ID"
 | 
			
		||||
        },
 | 
			
		||||
        "is_locked": {
 | 
			
		||||
          "type": "boolean",
 | 
			
		||||
          "x-go-name": "IsLocked"
 | 
			
		||||
        },
 | 
			
		||||
        "labels": {
 | 
			
		||||
          "type": "array",
 | 
			
		||||
          "items": {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user