#4 done. added qbucks, monthly and alltime leaderboards

This commit is contained in:
2025-09-13 17:07:44 +02:00
parent 6a78a7dcea
commit a4f9767f8d
5 changed files with 137 additions and 1 deletions

View File

@@ -23,6 +23,10 @@ export async function getUserRecord(user: User): Promise<userRecord> {
};
};
export async function getAllUserRecords(): Promise<userRecord[]> {
return await pb.getFullList();
};
async function createUserRecord(user: User): Promise<userRecord> {
const data = await pb.create({
id: user.id,
@@ -44,3 +48,11 @@ export async function updateUserRecord(user: User, newData: userRecord): Promise
return false;
};
};
export async function getBalanceLeaderboard() {
try {
return await pb.getList(1, 10, { sort: '-balance,id' }).then(a => a.items);
} catch (err) {
logger.err(err as string);
};
};