Skip to content

Commit

Permalink
Update invenio.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
mfenner committed Nov 8, 2024
1 parent 7d6ebda commit f298a0a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions invenio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def blogs_search_view_function():
The following routes are redirected as follows:
- /blogs -> GET /communities/search?q=<query>&f=<tags>&p=<page>
:return: url for the view 'invenio_app_rdm_communities.communities_search'
:return: url for the view 'invenio_communities.communities_search'
:rtype: str
"""
_q = request.args.get("query", "")
Expand All @@ -572,7 +572,7 @@ def blogs_search_view_function():
_f = f"subject:{category}"
_p = request.args.get("page", 1)
values = {"q": _q, "f": _f, "p": _p}
target = url_for("invenio_app_rdm_communities.communities_search", **values)
target = url_for("invenio_communities.communities_search", **values)
return target

def posts_detail_view_function():
Expand Down Expand Up @@ -601,13 +601,14 @@ def posts_search_view_function():
:rtype: str
"""
_q = request.args.get("query", "")
tags = request.args.get("tags", None)
category = request.args.get("category", None)
if tags:
_f = f"subject:{tags}"
elif category:
tags = request.args.get("tags", None)
_f = ""
if category:
category = camelcase_to_titlecase(category)
_f = f"subject:{category}"
if tags:
_f = f"subject:{tags}"
_p = request.args.get("page", 1)
values = {"q": _q, "f": _f, "p": _p}
target = url_for("invenio_search_ui.search", **values)
Expand Down

0 comments on commit f298a0a

Please sign in to comment.