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
pull/1714/head
TheCatLady 4 years ago committed by GitHub
parent e0491ab02a
commit a3f04b3f35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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,

Loading…
Cancel
Save