Skip to content

Commit b4e1637

Browse files
committed
Add get_leaderboard_for_challenge query (for future per-challenge filtering)
1 parent 46542ab commit b4e1637

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

crates/platform-server/src/db/queries.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,18 @@ pub async fn get_leaderboard(pool: &Pool, limit: usize) -> Result<Vec<Leaderboar
448448
.collect())
449449
}
450450

451+
/// Get leaderboard for a specific challenge
452+
/// For now, returns the global leaderboard (single challenge mode)
453+
pub async fn get_leaderboard_for_challenge(
454+
pool: &Pool,
455+
_challenge_id: &str,
456+
limit: usize,
457+
) -> Result<Vec<LeaderboardEntry>> {
458+
// Currently all submissions are for a single challenge
459+
// In the future, filter by challenge_id
460+
get_leaderboard(pool, limit).await
461+
}
462+
451463
// ============================================================================
452464
// CHALLENGE CONFIG
453465
// ============================================================================

0 commit comments

Comments
 (0)