From 950322f3206a0354563eecaf7b79674b2e1545d9 Mon Sep 17 00:00:00 2001 From: Basti Ortiz <39114273+BastiDood@users.noreply.github.com> Date: Thu, 11 Jul 2024 12:12:04 +0800 Subject: [PATCH] fix(user): prompt before sending lab rankings --- src/routes/dashboard/(draft)/ranks/+page.server.js | 2 +- .../dashboard/(draft)/ranks/SubmitRankings.svelte | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/routes/dashboard/(draft)/ranks/+page.server.js b/src/routes/dashboard/(draft)/ranks/+page.server.js index 36584e3..6c34b42 100644 --- a/src/routes/dashboard/(draft)/ranks/+page.server.js +++ b/src/routes/dashboard/(draft)/ranks/+page.server.js @@ -23,7 +23,7 @@ export const actions = { const maxRounds = await db.getMaxRoundInDraft(draft); if (maxRounds === null) error(404); - if (labs.length !== maxRounds) error(400); + if (labs.length > maxRounds) error(400); if (await db.insertStudentRanking(draft, user.email, labs)) return; return fail(403); diff --git a/src/routes/dashboard/(draft)/ranks/SubmitRankings.svelte b/src/routes/dashboard/(draft)/ranks/SubmitRankings.svelte index d7eb763..662824a 100644 --- a/src/routes/dashboard/(draft)/ranks/SubmitRankings.svelte +++ b/src/routes/dashboard/(draft)/ranks/SubmitRankings.svelte @@ -70,7 +70,11 @@