Fix init workspace in dev (#8799)

Signed-off-by: Anna Khismatullina <anna.khismatullina@gmail.com>
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
Co-authored-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Anna Khismatullina
2025-05-12 09:24:38 +05:00
committed by GitHub
co-authored by Alexey Zinoviev
parent 874f4e3262
commit 06fb92b7cb
15 changed files with 419 additions and 420 deletions
@@ -167,7 +167,7 @@ export async function OnPersonCreate (_txes: Tx[], control: TriggerControl): Pro
const lastOne = (
await control.findAll(control.ctx, card.class.Card, {}, { sort: { rank: SortingOrder.Descending }, limit: 1 })
)[0]
const userProfileTx = control.txFactory.createTxCreateDoc<UserProfile>(contact.class.UserProfile, ctx.space, {
const userProfileTx = control.txFactory.createTxCreateDoc<UserProfile>(contact.class.UserProfile, ctx.objectSpace, {
person: ctx.objectId,
title: formatName(ctx.attributes.name),
rank: makeRank(lastOne?.rank, undefined),
@@ -178,7 +178,7 @@ export async function OnPersonCreate (_txes: Tx[], control: TriggerControl): Pro
result.push(userProfileTx)
result.push(
control.txFactory.createTxUpdateDoc<Person>(ctx.objectClass, ctx.space, ctx.objectId, {
control.txFactory.createTxUpdateDoc<Person>(ctx.objectClass, ctx.objectSpace, ctx.objectId, {
profile: userProfileTx.objectId
})
)