From 72f053a4f3931139f2b02d1aee69889bacfd87e9 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Fri, 11 Apr 2025 09:49:38 +0500 Subject: [PATCH] Fix user in event copy (#8530) --- server-plugins/calendar-resources/src/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server-plugins/calendar-resources/src/index.ts b/server-plugins/calendar-resources/src/index.ts index c035456a80..7033fa3d2f 100644 --- a/server-plugins/calendar-resources/src/index.ts +++ b/server-plugins/calendar-resources/src/index.ts @@ -238,13 +238,14 @@ async function eventForNewParticipants ( const acc = accounts.find((a) => a.person === part) if (acc === undefined) continue if (acc._id === (event.createdBy ?? event.modifiedBy)) continue + const user = acc._id const calendar = getCalendar(calendars, acc._id, event.calendar) if (calendar === undefined) continue if (calendar === event.calendar) continue const innerTx = control.txFactory.createTxCreateDoc( _class, space, - { ...data, calendar, access }, + { ...data, calendar, access, user }, undefined, undefined, acc._id @@ -313,13 +314,14 @@ async function onEventCreate (ctx: TxCreateDoc, control: TriggerControl): const acc = accounts.find((a) => a.person === part) if (acc === undefined) continue if (acc._id === (event.createdBy ?? event.modifiedBy)) continue + const user = acc._id const calendar = getCalendar(calendars, acc._id, event.calendar) if (calendar === undefined) continue if (calendar === event.calendar) continue const innerTx = control.txFactory.createTxCreateDoc( _class, space, - { ...data, calendar, access }, + { ...data, calendar, access, user }, undefined, undefined, acc._id