mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-01 20:36:21 -05:00
Creating Zim search endpoint that searches all auto-search zim files.
This commit is contained in:
parent
e6aaab1016
commit
4918ea5ef6
2 changed files with 35 additions and 0 deletions
|
|
@ -57,6 +57,19 @@ async def post_set_zim_auto_search(request: Request, zim_id: int, body: schema.Z
|
|||
return response.empty()
|
||||
|
||||
|
||||
@zim_bp.post('/search')
|
||||
@openapi.definition(
|
||||
summary='Search all Zim files that have auto_search enabled',
|
||||
body=schema.ZimSearchRequest,
|
||||
)
|
||||
@validate(schema.ZimSearchRequest)
|
||||
async def search_all_zims(request: Request, body: schema.ZimSearchRequest):
|
||||
session = request.ctx.session
|
||||
results = lib.search_all_zims(session, body.search_str, tag_names=body.tag_names, offset=body.offset,
|
||||
limit=body.limit)
|
||||
return json_response({'zims': results})
|
||||
|
||||
|
||||
@zim_bp.post('/search/<zim_id:[0-9]+>')
|
||||
@openapi.definition(
|
||||
summary='Search all entries of a Zim',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue