()
| 47 | } |
| 48 | |
| 49 | export async function getLeaderboard() { |
| 50 | try { |
| 51 | const creatures = await db.query.creatures.findMany({ |
| 52 | orderBy: (creatures, { desc }) => desc(creatures.contributions), |
| 53 | limit: 10, |
| 54 | }); |
| 55 | return creatures; |
| 56 | } catch (error) { |
| 57 | console.error(error); |
| 58 | throw new Error("Failed to get leaderboard"); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | export async function getFollowersLeaderboard() { |
| 63 | try { |
no outgoing calls
no test coverage detected