|
|
@ -69,12 +69,14 @@ app.get('/submissions', async (req, res) => { |
|
|
|
if (!isNaN(minScore) || !isNaN(maxScore)) { |
|
|
|
if (!isNaN(minScore) || !isNaN(maxScore)) { |
|
|
|
if (isNaN(minScore)) minScore = 0; |
|
|
|
if (isNaN(minScore)) minScore = 0; |
|
|
|
if (isNaN(maxScore)) maxScore = 100; |
|
|
|
if (isNaN(maxScore)) maxScore = 100; |
|
|
|
where.score = { |
|
|
|
if (!(minScore === 0 && maxScore === 100)) { |
|
|
|
$and: { |
|
|
|
where.score = { |
|
|
|
$gte: parseInt(minScore), |
|
|
|
$and: { |
|
|
|
$lte: parseInt(maxScore) |
|
|
|
$gte: parseInt(minScore), |
|
|
|
} |
|
|
|
$lte: parseInt(maxScore) |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (req.query.language) { |
|
|
|
if (req.query.language) { |
|
|
|