Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0

Fix #1251 by implementing the page parameter in the url.

Now /p/xx works but also ?page=xx in api search/index
Cette révision appartient à :
akuma06 2017-07-20 23:06:20 +02:00
Parent 916d45a3af
révision 83f730dbf2
5 fichiers modifiés avec 18 ajouts et 17 suppressions

Voir le fichier

@ -23,6 +23,13 @@ define({ "api": [
"field": "q", "field": "q",
"description": "<p>Query to search (torrent name).</p>" "description": "<p>Query to search (torrent name).</p>"
}, },
{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "page",
"description": "<p>Page of the search results.</p>"
},
{ {
"group": "Parameter", "group": "Parameter",
"type": "String", "type": "String",
@ -120,13 +127,6 @@ define({ "api": [
"optional": false, "optional": false,
"field": "lang", "field": "lang",
"description": "<p>Filter the languages.</p>" "description": "<p>Filter the languages.</p>"
},
{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "page",
"description": "<p>Search page.</p>"
} }
] ]
} }

Voir le fichier

@ -23,6 +23,13 @@
"field": "q", "field": "q",
"description": "<p>Query to search (torrent name).</p>" "description": "<p>Query to search (torrent name).</p>"
}, },
{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "page",
"description": "<p>Page of the search results.</p>"
},
{ {
"group": "Parameter", "group": "Parameter",
"type": "String", "type": "String",
@ -120,13 +127,6 @@
"optional": false, "optional": false,
"field": "lang", "field": "lang",
"description": "<p>Filter the languages.</p>" "description": "<p>Filter the languages.</p>"
},
{
"group": "Parameter",
"type": "Number",
"optional": false,
"field": "page",
"description": "<p>Search page.</p>"
} }
] ]
} }

Voir le fichier

@ -26,7 +26,7 @@ define({
"apidoc": "0.3.0", "apidoc": "0.3.0",
"generator": { "generator": {
"name": "apidoc", "name": "apidoc",
"time": "2017-07-20T18:53:30.209Z", "time": "2017-07-20T21:04:54.468Z",
"url": "http://apidocjs.com", "url": "http://apidocjs.com",
"version": "0.17.6" "version": "0.17.6"
} }

Voir le fichier

@ -26,7 +26,7 @@
"apidoc": "0.3.0", "apidoc": "0.3.0",
"generator": { "generator": {
"name": "apidoc", "name": "apidoc",
"time": "2017-07-20T18:53:30.209Z", "time": "2017-07-20T21:04:54.468Z",
"url": "http://apidocjs.com", "url": "http://apidocjs.com",
"version": "0.17.6" "version": "0.17.6"
} }

Voir le fichier

@ -374,6 +374,7 @@ func APIUpdateHandler(c *gin.Context) {
* *
* @apiParam {String[]} c In which categories to search. * @apiParam {String[]} c In which categories to search.
* @apiParam {String} q Query to search (torrent name). * @apiParam {String} q Query to search (torrent name).
* @apiParam {Number} page Page of the search results.
* @apiParam {String} limit Number of results per page. * @apiParam {String} limit Number of results per page.
* @apiParam {String} userID Uploader ID owning the torrents. * @apiParam {String} userID Uploader ID owning the torrents.
* @apiParam {String} fromID Show results with torrents ID superior to this. * @apiParam {String} fromID Show results with torrents ID superior to this.
@ -405,7 +406,7 @@ func APIUpdateHandler(c *gin.Context) {
// APISearchHandler : Controller for searching with api // APISearchHandler : Controller for searching with api
func APISearchHandler(c *gin.Context) { func APISearchHandler(c *gin.Context) {
c.Header("Content-Type", "application/json") c.Header("Content-Type", "application/json")
page := c.Param("page") page := c.DefaultQuery("page", c.Param("page"))
currentUser := router.GetUser(c) currentUser := router.GetUser(c)
// db params url // db params url