mirror of
https://github.com/hcengineering/platform.git
synced 2025-02-08 03:47:20 +00:00
10 lines
405 B
TypeScript
10 lines
405 B
TypeScript
![]() |
import { Doc, Ref, TxOperations } from '@anticrm/core'
|
||
|
import { Lead } from '@anticrm/lead'
|
||
|
import lead from './plugin'
|
||
|
|
||
|
export async function getLeadTitle (client: TxOperations, ref: Ref<Doc>): Promise<string> {
|
||
|
const object = await client.findOne(lead.class.Lead, { _id: ref as Ref<Lead> })
|
||
|
if (object === undefined) throw new Error(`Lead not found, _id: ${ref}`)
|
||
|
return `LEAD-${object.number}`
|
||
|
}
|