📈(backend) capture an event when a document is moved

When a document is moved we want to capture an event. The position and
target_document_id is added to the sent properties.
This commit is contained in:
Manuel Raynaud
2026-06-01 17:47:28 +02:00
parent 0df2d753c4
commit c91c443b08
3 changed files with 68 additions and 16 deletions
+10
View File
@@ -1076,6 +1076,16 @@ class DocumentViewSet(
defaults={"role": models.RoleChoices.OWNER},
)
posthog_capture(
PosthogEventName.DOC_MOVED,
user,
{
"position": position,
"targeted_document_id": str(target_document_id),
},
document=document,
)
return drf.response.Response(
{"message": "Document moved successfully."}, status=status.HTTP_200_OK
)