feat(api): assist search by userId
This commit is contained in:
parent
729d5715b4
commit
c45d87d12e
2 changed files with 5 additions and 11 deletions
|
|
@ -64,9 +64,10 @@ def get_live_sessions(project_id, filters=None):
|
|||
return helper.list_to_camel_case(results)
|
||||
|
||||
|
||||
def get_live_sessions_ws(project_id):
|
||||
def get_live_sessions_ws(project_id, user_id=None):
|
||||
project_key = projects.get_project_key(project_id)
|
||||
connected_peers = requests.get(config("peers") % config("S3_KEY") + f"/{project_key}")
|
||||
connected_peers = requests.get(config("peers") % config("S3_KEY") \
|
||||
+ f"/{project_key}" + (f"?userId={user_id}" if user_id else ""))
|
||||
if connected_peers.status_code != 200:
|
||||
print("!! issue with the peer-server")
|
||||
print(connected_peers.text)
|
||||
|
|
|
|||
|
|
@ -820,15 +820,8 @@ def all_issue_types(context: schemas.CurrentContext = Depends(OR_context)):
|
|||
|
||||
|
||||
@app.get('/{projectId}/assist/sessions', tags=["assist"])
|
||||
def sessions_live(projectId: int, context: schemas.CurrentContext = Depends(OR_context)):
|
||||
data = assist.get_live_sessions_ws(projectId)
|
||||
return {'data': data}
|
||||
|
||||
|
||||
@app.post('/{projectId}/assist/sessions', tags=["assist"])
|
||||
def sessions_live_search(projectId: int, data: schemas.AssistSearchPayloadSchema = Body(...),
|
||||
context: schemas.CurrentContext = Depends(OR_context)):
|
||||
data = assist.get_live_sessions_ws(projectId)
|
||||
def sessions_live(projectId: int, userId: str = None, context: schemas.CurrentContext = Depends(OR_context)):
|
||||
data = assist.get_live_sessions_ws(projectId, user_id=userId)
|
||||
return {'data': data}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue