Skip to content

Commit

Permalink
fix(requests): do not prevent duplicate requests if other requests ar…
Browse files Browse the repository at this point in the history
…e declined
  • Loading branch information
sct committed Jun 10, 2021
1 parent 126d866 commit de0759c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/routes/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ requestRoutes.post('/', async (req, res, next) => {
.leftJoin('request.media', 'media')
.where('request.is4k = :is4k', { is4k: req.body.is4k })
.andWhere('media.tmdbId = :tmdbId', { tmdbId: tmdbMedia.id })
.andWhere('request.status != :requestStatus', {
requestStatus: MediaRequestStatus.DECLINED,
})
.getOne();

if (existing) {
Expand Down

0 comments on commit de0759c

Please sign in to comment.