Add search form for /nojs endpoint

Adds an html form to search books by the q= parameter
This commit is contained in:
Nikhil Tanwar
2023-02-16 02:19:15 +05:30
parent 0f7e11bd86
commit a48e2e6f06
4 changed files with 16 additions and 6 deletions

View File

@ -783,7 +783,8 @@ std::unique_ptr<Response> InternalServer::handle_no_js(const RequestContext& req
std::string content;
if (urlParts.size() == 1) {
content = htmlDumper.dumpPlainHTML();
const auto filter = get_search_filter(request);
content = htmlDumper.dumpPlainHTML(filter);
} else if ((urlParts.size() == 3) && (urlParts[1] == "download")) {
try {
const auto bookId = mp_nameMapper->getIdForName(urlParts[2]);
@ -797,7 +798,6 @@ std::unique_ptr<Response> InternalServer::handle_no_js(const RequestContext& req
+ urlNotFoundMsg;
}
return ContentResponse::build(
*this,
content,