Skip to content

Commit 7beb5fe

Browse files
committed
fix swagger and api param name
1 parent a79d794 commit 7beb5fe

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

routers/api/v1/repo/issue.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ func SearchIssues(ctx *context.APIContext) {
5151
// description: repository to prioritize in the results
5252
// type: integer
5353
// format: int64
54-
// - name: tp
54+
// - name: type
5555
// in: query
56-
// description: both issues and pull requests or one of them, could be prs, issues or blank
57-
// type: integer
58-
// format: int64
56+
// description: filter by type (issues / pulls) if set
57+
// type: string
5958
// responses:
6059
// "200":
6160
// "$ref": "#/responses/IssueList"
@@ -134,7 +133,7 @@ func SearchIssues(ctx *context.APIContext) {
134133
}
135134

136135
var isPull util.OptionalBool
137-
switch ctx.Query("tp") {
136+
switch ctx.Query("type") {
138137
case "pulls":
139138
isPull = util.OptionalBoolTrue
140139
case "issues":

templates/repo/issue/view_content/sidebar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@
428428
<input type="hidden" id="repolink" value="{{$.RepoRelPath}}">
429429
<input type="hidden" id="repoId" value="{{.Repository.ID}}">
430430
<input type="hidden" id="crossRepoSearch" value="{{.AllowCrossRepositoryDependencies}}">
431-
<input type="hidden" id="tp" value="{{.IssueType}}">
431+
<input type="hidden" id="type" value="{{.IssueType}}">
432432
<!-- I know, there is probably a better way to do this -->
433433
<input type="hidden" id="issueIndex" value="{{.Issue.Index}}"/>
434434

templates/swagger/v1_json.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,12 @@
13971397
"description": "repository to prioritize in the results",
13981398
"name": "priority_repo_id",
13991399
"in": "query"
1400+
},
1401+
{
1402+
"type": "string",
1403+
"description": "filter by type (issues / pulls) if set",
1404+
"name": "type",
1405+
"in": "query"
14001406
}
14011407
],
14021408
"responses": {

0 commit comments

Comments
 (0)