mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-29 03:21:13 +00:00
Fix links resolvers (#2761)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
0f24fe80d6
commit
29a0986241
@ -1,6 +1,6 @@
|
||||
import { chunterId, ChunterMessage, Comment, ThreadMessage } from '@hcengineering/chunter'
|
||||
import contact, { EmployeeAccount, getName } from '@hcengineering/contact'
|
||||
import { Class, Client, Doc, getCurrentAccount, Obj, Ref, SortingOrder, Space, Timestamp } from '@hcengineering/core'
|
||||
import { Class, Client, Doc, getCurrentAccount, Obj, Ref, Space, Timestamp } from '@hcengineering/core'
|
||||
import { Asset } from '@hcengineering/platform'
|
||||
import { getClient } from '@hcengineering/presentation'
|
||||
import { getCurrentLocation, getPanelURI, Location, navigate } from '@hcengineering/ui'
|
||||
@ -156,7 +156,7 @@ async function generateLocation (loc: Location, shortLink: string): Promise<Loca
|
||||
return undefined
|
||||
}
|
||||
const classLabel = tokens[0]
|
||||
const lastId = tokens[1]
|
||||
const lastId = tokens[1] as Ref<Doc>
|
||||
const client = getClient()
|
||||
const hierarchy = client.getHierarchy()
|
||||
const classes = [chunter.class.Message, chunter.class.ThreadMessage, chunter.class.Comment]
|
||||
@ -171,7 +171,7 @@ async function generateLocation (loc: Location, shortLink: string): Promise<Loca
|
||||
console.error(`Could not find class ${classLabel}.`)
|
||||
return undefined
|
||||
}
|
||||
const doc = await client.findOne(_class, { _id: { $like: `%${lastId}` } }, { sort: { _id: SortingOrder.Descending } })
|
||||
const doc = await client.findOne(_class, { _id: lastId })
|
||||
if (doc === undefined) {
|
||||
console.error(`Could not find message ${lastId}.`)
|
||||
return undefined
|
||||
|
@ -23,7 +23,7 @@ import {
|
||||
formatName,
|
||||
getName
|
||||
} from '@hcengineering/contact'
|
||||
import { Doc, getCurrentAccount, ObjQueryType, Ref, SortingOrder, Timestamp, toIdMap } from '@hcengineering/core'
|
||||
import { Doc, getCurrentAccount, ObjQueryType, Ref, Timestamp, toIdMap } from '@hcengineering/core'
|
||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||
import { TemplateDataProvider } from '@hcengineering/templates'
|
||||
import { getPanelURI, Location } from '@hcengineering/ui'
|
||||
@ -185,7 +185,7 @@ async function generateLocation (loc: Location, shortLink: string): Promise<Loca
|
||||
return undefined
|
||||
}
|
||||
const classLabel = tokens[0]
|
||||
const lastId = tokens[1]
|
||||
const lastId = tokens[1] as Ref<Contact>
|
||||
const client = getClient()
|
||||
const hierarchy = client.getHierarchy()
|
||||
const classes = hierarchy.getDescendants(contact.class.Contact)
|
||||
@ -196,7 +196,7 @@ async function generateLocation (loc: Location, shortLink: string): Promise<Loca
|
||||
break
|
||||
}
|
||||
}
|
||||
const doc = await client.findOne(_class, { _id: { $like: `%${lastId}` } }, { sort: { _id: SortingOrder.Descending } })
|
||||
const doc = await client.findOne(_class, { _id: lastId })
|
||||
if (doc === undefined) {
|
||||
console.error(`Could not find contact ${lastId}.`)
|
||||
return undefined
|
||||
|
Loading…
Reference in New Issue
Block a user