mirror of
https://github.com/suitenumerique/docs.git
synced 2026-09-09 19:27:55 +02:00
📈(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:
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user