fix(requests): do not prevent duplicate requests if other requests are declined

pull/1776/head
sct 4 years ago
parent 126d8665ee
commit de0759c26a
No known key found for this signature in database
GPG Key ID: 77D146606D30DCCD

@ -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) {

Loading…
Cancel
Save