Skip to content

Commit

Permalink
Merge pull request #157 from EOSC-synergy/fix/add_query_param
Browse files Browse the repository at this point in the history
Support for a query 'q' parameter
  • Loading branch information
PalomoIFCA authored Mar 4, 2024
2 parents 7bca8ec + 8a473a2 commit 9835e69
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions api/rda.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ def load_evaluator(wrapped_func):
@wraps(wrapped_func)
def wrapper(body, **kwargs):
repo = body.get("repo")
item_id = body.get("id")
item_id = body.get("id", "")
oai_base = body.get("oai_base")
lang = body.get("lang", "en")
logger.debug(
"Parsing input args: (repo: %s, item_id: %s, oai_base: %s, lang: %s)"
% (repo, item_id, oai_base, lang)
)
pattern_to_query = body.get("q", "")

logger.debug("JSON payload received: %s" % body)
if not (item_id or pattern_to_query):
msg = "Neither the identifier nor the pattern to query was provided. Exiting.."
logger.error(msg)
return msg, 400
try:
if repo == "oai-pmh":
eva = Evaluator(item_id, oai_base, lang)
Expand Down

0 comments on commit 9835e69

Please sign in to comment.