From a67c3aac10c9e0f89792ea33cd8ac7d1aec10b5f Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Tue, 8 Aug 2023 19:49:51 +0700 Subject: [PATCH] UBER-710: Fix preference notifications --- server/middleware/src/private.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/middleware/src/private.ts b/server/middleware/src/private.ts index c6c00131c38..0314b6fe006 100644 --- a/server/middleware/src/private.ts +++ b/server/middleware/src/private.ts @@ -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)