Skip to content

Commit

Permalink
fix: fixes an issue with vocabs in search not showing up
Browse files Browse the repository at this point in the history
  • Loading branch information
sennierer committed Jul 7, 2023
1 parent 54ff03c commit 9ca2877
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion intavia_backend/main_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
RequestID,
Search,
Search_Base,
SearchEventKindVocab,
SearchEvents,
SearchOccupationsStats,
SearchVocabs,
Expand Down Expand Up @@ -438,7 +439,7 @@ async def bulk_retrieve_voc_event_roles(
description="Endpoint that allows to query and retrieve event kinds.",
)
@cache()
async def query_event_kind(search: SearchVocabs = Depends()):
async def query_event_kind(search: SearchEventKindVocab = Depends()):
res = get_query_from_triplestore_v2(search, "event_kind_v2_1.sparql")
res = flatten_rdf_data(res)
pages = math.ceil(int(res[0]["count"]) / search.limit) if len(res) > 0 else 0
Expand Down
6 changes: 6 additions & 0 deletions intavia_backend/query_parameters_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@ class SearchOccupationsStats(Search_Base, QueryBase):
class SearchEvents(SearchEventsBase, QueryBase):
pass

@dataclasses.dataclass(kw_only=True)
class SearchEventKindVocab(QueryBase):
q: str = Query(
default=None,
description="Query for a label in the Vocabulary. Matching is done on substring level.",
)

@dataclasses.dataclass(kw_only=True)
class SearchVocabs(QueryBase):
Expand Down

0 comments on commit 9ca2877

Please sign in to comment.