mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-14 04:08:19 +00:00
Fix automation (#4531)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
5d945aedc1
commit
1b4a574a1c
@ -19,16 +19,15 @@ import contact, {
|
|||||||
Contact,
|
Contact,
|
||||||
Organization,
|
Organization,
|
||||||
Person,
|
Person,
|
||||||
contactId,
|
|
||||||
getName,
|
|
||||||
formatContactName,
|
|
||||||
PersonAccount,
|
PersonAccount,
|
||||||
|
contactId,
|
||||||
|
formatContactName,
|
||||||
formatName,
|
formatName,
|
||||||
getLastName,
|
|
||||||
getFirstName,
|
getFirstName,
|
||||||
Employee
|
getLastName,
|
||||||
|
getName
|
||||||
} from '@hcengineering/contact'
|
} from '@hcengineering/contact'
|
||||||
import { Ref, Class, Doc, Tx, TxRemoveDoc, TxUpdateDoc, concatLink, Hierarchy } from '@hcengineering/core'
|
import { Class, Doc, Hierarchy, Ref, Tx, TxRemoveDoc, TxUpdateDoc, concatLink } from '@hcengineering/core'
|
||||||
import notification, { Collaborators } from '@hcengineering/notification'
|
import notification, { Collaborators } from '@hcengineering/notification'
|
||||||
import { getMetadata } from '@hcengineering/platform'
|
import { getMetadata } from '@hcengineering/platform'
|
||||||
import serverCore, { TriggerControl } from '@hcengineering/server-core'
|
import serverCore, { TriggerControl } from '@hcengineering/server-core'
|
||||||
@ -204,9 +203,9 @@ export async function getCurrentEmployeePosition (
|
|||||||
_id: control.txFactory.account as Ref<PersonAccount>
|
_id: control.txFactory.account as Ref<PersonAccount>
|
||||||
})
|
})
|
||||||
if (account === undefined) return ''
|
if (account === undefined) return ''
|
||||||
const employee = (await control.findAll(contact.mixin.Employee, { _id: account.person as Ref<Employee> }))[0]
|
const employee = (await control.findAll(contact.class.Person, { _id: account.person }))[0]
|
||||||
if (employee !== undefined) {
|
if (employee !== undefined) {
|
||||||
return employee.position ?? ''
|
return control.hierarchy.as(employee, contact.mixin.Employee)?.position ?? ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,8 +97,8 @@ export default async () => ({
|
|||||||
IntegrationHTMLPresenter: integrationHTMLPresenter,
|
IntegrationHTMLPresenter: integrationHTMLPresenter,
|
||||||
IntegrationTextPresenter: integrationTextPresenter,
|
IntegrationTextPresenter: integrationTextPresenter,
|
||||||
GetValue: getValue,
|
GetValue: getValue,
|
||||||
GetFirstName: getFirstName,
|
GetFirstName: getOwnerFirstName,
|
||||||
GetLastName: getLastName,
|
GetLastName: getOwnerLastName,
|
||||||
GetOwnerPosition: getOwnerPosition
|
GetOwnerPosition: getOwnerPosition
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user