mirror of
https://github.com/suitenumerique/docs.git
synced 2026-09-30 13:35:10 +02:00
📈(backend) capture an event when a document is duplicated
We want to capture an event when a document is duplicated. The document from where come from the duplication is added in the properties.
This commit is contained in:
@@ -1343,6 +1343,15 @@ class DocumentViewSet(
|
||||
user=user,
|
||||
)
|
||||
|
||||
posthog_capture(
|
||||
PosthogEventName.DOC_DUPLICATED,
|
||||
user,
|
||||
{
|
||||
"duplicated_from": str(document_to_duplicate.id),
|
||||
},
|
||||
document=duplicated_document,
|
||||
)
|
||||
|
||||
return drf_response.Response(
|
||||
{"id": str(duplicated_document.id)}, status=status.HTTP_201_CREATED
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user