fix(chalice): added get note by id (#3069)

This commit is contained in:
Kraiem Taha Yassine 2025-02-27 18:30:44 +01:00 committed by GitHub
parent e2fa3c91e2
commit 4e54bced9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -503,6 +503,18 @@ def comment_assignment(projectId: int, sessionId: int, issueId: str,
}
@app.get('/{projectId}/notes/{noteId}', tags=["sessions", "notes"],
dependencies=[OR_scope(Permissions.SESSION_REPLAY)])
def get_note_by_id(projectId: int, noteId: int, context: schemas.CurrentContext = Depends(OR_context)):
data = sessions_notes.get_note(tenant_id=context.tenant_id, project_id=projectId, note_id=noteId,
user_id=context.user_id)
if "errors" in data:
return data
return {
'data': data
}
@app.post('/{projectId}/sessions/{sessionId}/notes', tags=["sessions", "notes"],
dependencies=[OR_scope(Permissions.SESSION_REPLAY)])
def create_note(projectId: int, sessionId: int, data: schemas.SessionNoteSchema = Body(...),