diff --git a/models/love/src/index.ts b/models/love/src/index.ts index 97abdabe059..753077bb806 100644 --- a/models/love/src/index.ts +++ b/models/love/src/index.ts @@ -180,7 +180,7 @@ export class TMeeting extends TEvent implements Meeting { room!: Ref } -@Model(love.class.MeetingMinutes, core.class.Doc, DOMAIN_MEETING_MINUTES) +@Model(love.class.MeetingMinutes, core.class.AttachedDoc, DOMAIN_MEETING_MINUTES) @UX( love.string.MeetingMinutes, love.icon.MeetingMinutes, diff --git a/plugins/love-resources/src/meetings.ts b/plugins/love-resources/src/meetings.ts index 4668ae8af41..c6e5b5bb86e 100644 --- a/plugins/love-resources/src/meetings.ts +++ b/plugins/love-resources/src/meetings.ts @@ -172,13 +172,10 @@ async function moveToMeetingRoom (room: Room): Promise { async function createMeetingDocument (room: Room): Promise { const client = getClient() - await client.createDoc(love.class.MeetingMinutes, core.space.Workspace, { + await client.addCollection(love.class.MeetingMinutes, core.space.Workspace, room._id, love.class.Room, 'meetings', { description: null, - attachedTo: room._id, status: MeetingStatus.Active, - title: await getNewMeetingTitle(room), - attachedToClass: love.class.Room, - collection: 'meetings' + title: await getNewMeetingTitle(room) }) } diff --git a/server-plugins/love-resources/src/index.ts b/server-plugins/love-resources/src/index.ts index 955df80e69e..3bef39035a2 100644 --- a/server-plugins/love-resources/src/index.ts +++ b/server-plugins/love-resources/src/index.ts @@ -225,7 +225,7 @@ async function roomJoinHandler (info: ParticipantInfo, control: TriggerControl): year: 'numeric' }) .replace(',', ' at') - const tx = control.txFactory.createTxCreateDoc( + const innerTx = control.txFactory.createTxCreateDoc( love.class.MeetingMinutes, core.space.Workspace, { @@ -238,6 +238,13 @@ async function roomJoinHandler (info: ParticipantInfo, control: TriggerControl): }, _id ) + const tx = control.txFactory.createTxCollectionCUD( + love.class.Room, + info.room, + core.space.Workspace, + 'meetings', + innerTx + ) tx.space = core.space.Tx res.push(tx) res.push(