mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-02 13:52:40 +00:00
Remove contact resolver id check (#2910)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
6e10f571ad
commit
b068478d83
@ -181,19 +181,13 @@ export async function getContactLink (doc: Doc): Promise<Location> {
|
|||||||
return loc
|
return loc
|
||||||
}
|
}
|
||||||
|
|
||||||
function isId (id: Ref<Contact>): boolean {
|
|
||||||
return /^[0-9a-z]{24}$/.test(id)
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function resolveLocation (loc: Location): Promise<ResolvedLocation | undefined> {
|
export async function resolveLocation (loc: Location): Promise<ResolvedLocation | undefined> {
|
||||||
if (loc.path[2] !== contactId) {
|
if (loc.path[2] !== contactId) {
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
const id = loc.path[3] as Ref<Contact>
|
const id = loc.path[3] as Ref<Contact>
|
||||||
if (isId(id)) {
|
return await generateLocation(loc, id)
|
||||||
return await generateLocation(loc, id)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function generateLocation (loc: Location, id: Ref<Contact>): Promise<ResolvedLocation | undefined> {
|
async function generateLocation (loc: Location, id: Ref<Contact>): Promise<ResolvedLocation | undefined> {
|
||||||
|
Loading…
Reference in New Issue
Block a user