mirror of
https://github.com/Suwayomi/Tachidesk.git
synced 2026-01-04 10:52:34 +01:00
empty searchTerm support (#259)
* linter run * convert search params to queryParams
This commit is contained in:
@@ -47,8 +47,8 @@ object MangaAPI {
|
||||
get("{sourceId}/filters", SourceController::getFilters)
|
||||
post("{sourceId}/filters", SourceController::setFilter)
|
||||
|
||||
get("{sourceId}/search/{searchTerm}/{pageNum}", SourceController::searchSingle)
|
||||
// get("search/{searchTerm}/{pageNum}", SourceController::searchGlobal)
|
||||
get("{sourceId}/search", SourceController::searchSingle)
|
||||
// get("all/search", SourceController::searchGlobal) // TODO
|
||||
}
|
||||
|
||||
path("manga") {
|
||||
|
||||
@@ -80,8 +80,8 @@ object SourceController {
|
||||
/** single source search */
|
||||
fun searchSingle(ctx: Context) {
|
||||
val sourceId = ctx.pathParam("sourceId").toLong()
|
||||
val searchTerm = ctx.pathParam("searchTerm")
|
||||
val pageNum = ctx.pathParam("pageNum").toInt()
|
||||
val searchTerm = ctx.queryParam("searchTerm") ?: ""
|
||||
val pageNum = ctx.queryParam("pageNum")?.toInt() ?: 1
|
||||
ctx.future(future { Search.sourceSearch(sourceId, searchTerm, pageNum) })
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@ import java.io.File
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
fun File.renameTo(newPath: String) = renameTo(File(newPath))
|
||||
fun File.renameTo(newPath: String) = renameTo(File(newPath))
|
||||
|
||||
Reference in New Issue
Block a user