From a3f04b3f3522d46dc65178bddd1e986426e48050 Mon Sep 17 00:00:00 2001 From: TheCatLady <52870424+TheCatLady@users.noreply.github.com> Date: Fri, 4 Jun 2021 13:48:04 -0400 Subject: [PATCH] fix(requests): appropriately set modifiedBy user for new requests (#1684) * fix(requests): do not set modifiedBy user for auto-approved requests * fix(requests): set modifiedBy user for requests on behalf of other users --- server/routes/request.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/server/routes/request.ts b/server/routes/request.ts index 1bde2259d..f3ee5ca72 100644 --- a/server/routes/request.ts +++ b/server/routes/request.ts @@ -293,20 +293,7 @@ requestRoutes.post('/', async (req, res, next) => { ) ? MediaRequestStatus.APPROVED : MediaRequestStatus.PENDING, - modifiedBy: req.user?.hasPermission( - [ - req.body.is4k - ? Permission.AUTO_APPROVE_4K - : Permission.AUTO_APPROVE, - req.body.is4k - ? Permission.AUTO_APPROVE_4K_MOVIE - : Permission.AUTO_APPROVE_MOVIE, - Permission.MANAGE_REQUESTS, - ], - { type: 'or' } - ) - ? req.user - : undefined, + modifiedBy: requestUser.id === req.user?.id ? undefined : req.user, is4k: req.body.is4k, serverId: req.body.serverId, profileId: req.body.profileId,