diff --git a/api/chalicelib/core/sessions_notes.py b/api/chalicelib/core/sessions_notes.py index 89e5c6d3d..4bc2138e1 100644 --- a/api/chalicelib/core/sessions_notes.py +++ b/api/chalicelib/core/sessions_notes.py @@ -125,16 +125,15 @@ def edit(tenant_id, user_id, project_id, note_id, data: schemas.SessionUpdateNot return {"errors": ["Note not found"]} -def delete(tenant_id, user_id, project_id, note_id): +def delete(project_id, note_id): with pg_client.PostgresClient() as cur: cur.execute( cur.mogrify(""" UPDATE public.sessions_notes SET deleted_at = timezone('utc'::text, now()) WHERE note_id = %(note_id)s AND project_id = %(project_id)s - AND user_id = %(user_id)s AND deleted_at ISNULL;""", - {"project_id": project_id, "user_id": user_id, "note_id": note_id}) + {"project_id": project_id, "note_id": note_id}) ) return {"data": {"state": "success"}} diff --git a/api/routers/core_dynamic.py b/api/routers/core_dynamic.py index 2825cec4b..f97ea6c23 100644 --- a/api/routers/core_dynamic.py +++ b/api/routers/core_dynamic.py @@ -485,8 +485,7 @@ def edit_note(projectId: int, noteId: int, data: schemas.SessionUpdateNoteSchema @app.delete('/{projectId}/notes/{noteId}', tags=["sessions", "notes"]) def delete_note(projectId: int, noteId: int, _=Body(None), context: schemas.CurrentContext = Depends(OR_context)): - data = sessions_notes.delete(tenant_id=context.tenant_id, project_id=projectId, user_id=context.user_id, - note_id=noteId) + data = sessions_notes.delete(project_id=projectId, note_id=noteId) return data diff --git a/ee/api/chalicelib/core/sessions_notes.py b/ee/api/chalicelib/core/sessions_notes.py index 46c974c1a..97ab14f9c 100644 --- a/ee/api/chalicelib/core/sessions_notes.py +++ b/ee/api/chalicelib/core/sessions_notes.py @@ -128,16 +128,15 @@ def edit(tenant_id, user_id, project_id, note_id, data: schemas.SessionUpdateNot return row -def delete(tenant_id, user_id, project_id, note_id): +def delete(project_id, note_id): with pg_client.PostgresClient() as cur: cur.execute( cur.mogrify(""" UPDATE public.sessions_notes SET deleted_at = timezone('utc'::text, now()) WHERE note_id = %(note_id)s AND project_id = %(project_id)s - AND user_id = %(user_id)s AND deleted_at ISNULL;""", - {"project_id": project_id, "user_id": user_id, "note_id": note_id}) + {"project_id": project_id, "note_id": note_id}) ) return {"data": {"state": "success"}} diff --git a/ee/api/routers/core_dynamic.py b/ee/api/routers/core_dynamic.py index 56b8fb9ce..c4ce05da7 100644 --- a/ee/api/routers/core_dynamic.py +++ b/ee/api/routers/core_dynamic.py @@ -521,8 +521,7 @@ def edit_note(projectId: int, noteId: int, data: schemas.SessionUpdateNoteSchema @app.delete('/{projectId}/notes/{noteId}', tags=["sessions", "notes"], dependencies=[OR_scope(Permissions.session_replay)]) def delete_note(projectId: int, noteId: int, _=Body(None), context: schemas.CurrentContext = Depends(OR_context)): - data = sessions_notes.delete(tenant_id=context.tenant_id, project_id=projectId, user_id=context.user_id, - note_id=noteId) + data = sessions_notes.delete(project_id=projectId, note_id=noteId) return data