Skip to content

Commit

Permalink
fix(requests): appropriately set modifiedBy user for new requests (sc…
Browse files Browse the repository at this point in the history
…t#1684)

* fix(requests): do not set modifiedBy user for auto-approved requests

* fix(requests): set modifiedBy user for requests on behalf of other users
  • Loading branch information
TheCatLady authored Jun 4, 2021
1 parent e0491ab commit a3f04b3
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions server/routes/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a3f04b3

Please sign in to comment.