diff --git a/api/routers/core.py b/api/routers/core.py index 34d221f4e..81b1dabdb 100644 --- a/api/routers/core.py +++ b/api/routers/core.py @@ -135,13 +135,15 @@ def comment_assignment(projectId: int, sessionId: int, issueId: str, data: schem def events_search(projectId: int, q: str, type: Union[schemas.FilterType, schemas.EventType, schemas.PerformanceEventType, schemas.FetchFilterType, - schemas.GraphqlFilterType] = None, + schemas.GraphqlFilterType, str] = None, key: str = None, source: str = None, live: bool = False, context: schemas.CurrentContext = Depends(OR_context)): if len(q) == 0: return {"data": []} if live: - return assist.autocomplete(project_id=projectId, q=q, key=key) + return assist.autocomplete(project_id=projectId, q=q, key=type.value) + if isinstance(type, str): + return {"errors": ["Unsupported type"]} if type in [schemas.FetchFilterType._url]: type = schemas.EventType.request elif type in [schemas.GraphqlFilterType._name]: