chore: formattato il codice e rimosso un vecchio file

This commit is contained in:
2023-01-10 01:36:29 +01:00
parent 476c0b4a71
commit 2901a1f899
7 changed files with 41 additions and 61 deletions
+5 -5
View File
@@ -229,14 +229,14 @@ export async function createApiRouter() {
solutions.forEach(s => {
if (!stats[s.sentBy]) {
stats[s.sentBy] = {
sentSolutionsCount: s.status !== "pending" ? 1 : 0,
correctSolutionsCount: s.status === "correct" ? 1 : 0
sentSolutionsCount: s.status !== 'pending' ? 1 : 0,
correctSolutionsCount: s.status === 'correct' ? 1 : 0,
}
} else {
if (s.status !== "pending") {
if (s.status !== 'pending') {
stats[s.sentBy].sentSolutionsCount += 1
}
if (s.status === "correct") {
if (s.status === 'correct') {
stats[s.sentBy].correctSolutionsCount += 1
}
}
@@ -248,7 +248,7 @@ export async function createApiRouter() {
r.get('/api/solutions', async (req, res) => {
let queryUser = (req.query.user ?? null) as UserId | null
let queryProblem = (req.query.problem ?? null) as ProblemId | null
let isPublic = (req.query.public === '')
let isPublic = req.query.public === ''
const requestUser = await getRequestUser(req)