mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 20:45:00 +02:00
UBERF-7532: Bulk operations for triggers (#6023)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -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, {}))
|
||||
|
||||
Reference in New Issue
Block a user