Fix user in event copy (#8530)

This commit is contained in:
Denis Bykhov 2025-04-11 09:49:38 +05:00 committed by GitHub
parent b5fe4de4ef
commit 72f053a4f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -238,13 +238,14 @@ async function eventForNewParticipants (
const acc = accounts.find((a) => a.person === part) const acc = accounts.find((a) => a.person === part)
if (acc === undefined) continue if (acc === undefined) continue
if (acc._id === (event.createdBy ?? event.modifiedBy)) continue if (acc._id === (event.createdBy ?? event.modifiedBy)) continue
const user = acc._id
const calendar = getCalendar(calendars, acc._id, event.calendar) const calendar = getCalendar(calendars, acc._id, event.calendar)
if (calendar === undefined) continue if (calendar === undefined) continue
if (calendar === event.calendar) continue if (calendar === event.calendar) continue
const innerTx = control.txFactory.createTxCreateDoc( const innerTx = control.txFactory.createTxCreateDoc(
_class, _class,
space, space,
{ ...data, calendar, access }, { ...data, calendar, access, user },
undefined, undefined,
undefined, undefined,
acc._id acc._id
@ -313,13 +314,14 @@ async function onEventCreate (ctx: TxCreateDoc<Event>, control: TriggerControl):
const acc = accounts.find((a) => a.person === part) const acc = accounts.find((a) => a.person === part)
if (acc === undefined) continue if (acc === undefined) continue
if (acc._id === (event.createdBy ?? event.modifiedBy)) continue if (acc._id === (event.createdBy ?? event.modifiedBy)) continue
const user = acc._id
const calendar = getCalendar(calendars, acc._id, event.calendar) const calendar = getCalendar(calendars, acc._id, event.calendar)
if (calendar === undefined) continue if (calendar === undefined) continue
if (calendar === event.calendar) continue if (calendar === event.calendar) continue
const innerTx = control.txFactory.createTxCreateDoc( const innerTx = control.txFactory.createTxCreateDoc(
_class, _class,
space, space,
{ ...data, calendar, access }, { ...data, calendar, access, user },
undefined, undefined,
undefined, undefined,
acc._id acc._id