mirror of
https://github.com/mudabbir-ahmad/peworkshop.git
synced 2026-10-07 19:50:20 +00:00
fixed stats page to show correct number of skipped clues. reflected this change accurately in leaderboards for users and admins as to not create a bug where a skipped clue would contribute to progress
This commit is contained in:
1 parent
2f9a6c732c
commit
4cd449c0cf
8 files changed
+46
-39
No files matched your search
@@ -23,7 +23,8 @@ async function verifyAdmin(request) {
|
||||
return { authorized: true, token };
|
||||
}
|
||||
|
||||
export async function POST(request, context) {
|
||||
// Make sure the reset progress API also handles the skipped flag
|
||||
export async function POST(request, { params }) {
|
||||
try {
|
||||
// Verify admin access
|
||||
const { authorized, error, status } = await verifyAdmin(request);
|
||||
@@ -31,7 +32,7 @@ export async function POST(request, context) {
|
||||
return Response.json({ error }, { status });
|
||||
}
|
||||
|
||||
const { teamId } = context.params;
|
||||
const { teamId } = params;
|
||||
|
||||
// Validate teamId is a number
|
||||
if (isNaN(parseInt(teamId))) {
|
||||
@@ -44,7 +45,7 @@ export async function POST(request, context) {
|
||||
return Response.json({ error: "Team not found" }, { status: 404 });
|
||||
}
|
||||
|
||||
// Delete all clue progress for the team
|
||||
// When resetting progress, make sure to reset skipped status too
|
||||
await run("DELETE FROM team_clues WHERE team_id = ?", [teamId]);
|
||||
|
||||
return Response.json({
|
||||
|
||||
Reference in new issue
Block a user