Skip to content

Commit

Permalink
UBER-710: Fix preference notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
haiodo committed Aug 8, 2023
1 parent 07cc690 commit a67c3aa
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 a67c3aa

Please sign in to comment.