mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-10-19 15:44:27 +00:00
fix(documents): include metadata in creation events
This commit is contained in:
parent
7dfa8a07d8
commit
bea26a897c
2 changed files with 12 additions and 1 deletions
|
|
@ -1045,6 +1045,7 @@ async def commit_staged_filesystem_state(
|
|||
"documentType": DocumentType.NOTE.value,
|
||||
"workspaceId": workspace_id,
|
||||
"folderId": new_doc.folder_id,
|
||||
"createdAt": int(new_doc.created_at.timestamp() * 1000),
|
||||
"createdById": str(created_by_id)
|
||||
if created_by_id
|
||||
else None,
|
||||
|
|
|
|||
|
|
@ -184,6 +184,16 @@ async def _save_export_document(
|
|||
workspace_id=workspace_id,
|
||||
created_by_id=None,
|
||||
)
|
||||
document_event = {
|
||||
"id": doc.id,
|
||||
"title": doc.title,
|
||||
"documentType": doc.document_type.value,
|
||||
"workspaceId": workspace_id,
|
||||
"folderId": doc.folder_id,
|
||||
"createdById": None,
|
||||
"createdAt": int(doc.created_at.timestamp() * 1000),
|
||||
"virtualPath": path,
|
||||
}
|
||||
await session.commit()
|
||||
doc_id = doc.id
|
||||
except ValueError as exc:
|
||||
|
|
@ -198,7 +208,7 @@ async def _save_export_document(
|
|||
|
||||
await adispatch_custom_event(
|
||||
"document_created",
|
||||
{"id": doc_id, "title": path.rsplit("/", 1)[-1], "virtualPath": path},
|
||||
document_event,
|
||||
)
|
||||
except Exception:
|
||||
logger.debug("export_run: document_created dispatch failed", exc_info=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue