Skip to content

Commit

Permalink
UBER-710: Fix preference notifications (#3574)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
  • Loading branch information
haiodo authored and annano committed Aug 24, 2023
1 parent d583281 commit da9f099
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/middleware/src/private.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit da9f099

Please sign in to comment.