calendar_hot_fixes (#3571)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2023-08-08 20:17:35 +07:00
committed by GitHub
parent 07cc690d23
commit 58dfa9d4a7
2 changed files with 6 additions and 17 deletions
+3 -14
View File
@@ -113,20 +113,9 @@ async function onEventCreate (tx: Tx, control: TriggerControl): Promise<Tx[]> {
(p) => (p._id !== ev.createdBy ?? ev.modifiedBy) && ev.participants.includes(p.person)
)
for (const acc of participants) {
const innerTx = control.txFactory.createTxCreateDoc(ev._class, `${acc._id}_calendar` as Ref<Calendar>, {
eventId: ev.eventId,
participants: ev.participants,
externalParticipants: ev.externalParticipants,
title: ev.title,
description: ev.description,
allDay: ev.allDay,
attachedTo: ev.attachedTo,
attachedToClass: ev.attachedToClass,
collection: ev.collection,
date: ev.date,
dueDate: ev.dueDate,
reminders: ev.reminders,
location: ev.location,
const { _id, _class, space, modifiedBy, modifiedOn, ...data } = ev
const innerTx = control.txFactory.createTxCreateDoc(_class, `${acc._id}_calendar` as Ref<Calendar>, {
...data,
access: 'reader'
})
res.push(