feat(api): assist type-autocomplete
This commit is contained in:
parent
3738dea76d
commit
005faf75b1
1 changed files with 4 additions and 2 deletions
|
|
@ -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]:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue