mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-23 14:06:00 +03:00
UBER-710: Fix preference notifications (#3574)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
50b19ad538
commit
6ef7d36fd8
@ -64,7 +64,11 @@ export class PrivateMiddleware extends BaseMiddleware implements Middleware {
|
||||
if (account !== tx.modifiedBy && account !== core.account.System) {
|
||||
throw new PlatformError(new Status(Severity.ERROR, platform.status.Forbidden, {}))
|
||||
}
|
||||
const modifiedByAccount = await this.storage.modelDb.findAll(core.class.Account, { _id: tx.modifiedBy })
|
||||
target = [ctx.userEmail, systemAccountEmail]
|
||||
if (modifiedByAccount.length > 0 && !target.includes(modifiedByAccount[0].email)) {
|
||||
target.push(modifiedByAccount[0].email)
|
||||
}
|
||||
}
|
||||
}
|
||||
const res = await this.provideTx(ctx, tx)
|
||||
|
Loading…
Reference in New Issue
Block a user