UBERF-7532: Bulk operations for triggers (#6023)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2024-07-09 00:04:05 +07:00
committed by GitHub
parent fa82ee1939
commit 4eac1927f0
49 changed files with 656 additions and 693 deletions
-12
View File
@@ -17,18 +17,6 @@ import core, { Account, AccountRole, systemAccountEmail } from '@hcengineering/c
import platform, { PlatformError, Severity, Status } from '@hcengineering/platform'
import { SessionContext, type ServerStorage } from '@hcengineering/server-core'
export function mergeTargets (current: string[] | undefined, prev: string[] | undefined): string[] | undefined {
if (current === undefined) return prev
if (prev === undefined) return current
const res: string[] = []
for (const value of current) {
if (prev.includes(value)) {
res.push(value)
}
}
return res
}
export async function getUser (storage: ServerStorage, ctx: SessionContext): Promise<Account> {
if (ctx.userEmail === undefined) {
throw new PlatformError(new Status(Severity.ERROR, platform.status.Forbidden, {}))