feat: implement PocketBase database schema setup script and core API service for content management
This commit is contained in:
@@ -205,7 +205,8 @@ export async function setLearnDone(userId, weekNumber) {
|
||||
// ── Leaderboard ───────────────────────────────────────────────────────────────
|
||||
|
||||
export async function getLeaderboard() {
|
||||
return pb.collection('leaderboard').getFullList({ sort: '-points' });
|
||||
const entries = await pb.collection('leaderboard').getFullList();
|
||||
return entries.sort((a, b) => (b.points || 0) - (a.points || 0));
|
||||
}
|
||||
|
||||
export async function upsertLeaderboardEntry(userId, name, pointsDelta, testsCompletedDelta = 0) {
|
||||
|
||||
Reference in New Issue
Block a user