diff --git a/server/api/validators/index.get.ts b/server/api/validators/index.get.ts index 956e939..c4487c3 100644 --- a/server/api/validators/index.get.ts +++ b/server/api/validators/index.get.ts @@ -1,3 +1,5 @@ +import { desc } from 'drizzle-orm'; + export default defineEventHandler(async (event) => { const data = await useDrizzle() .select({ @@ -18,6 +20,7 @@ export default defineEventHandler(async (event) => { .from(tables.validators) .leftJoin(tables.scores, eq(tables.validators.id, tables.scores.validatorId)) .groupBy(tables.validators.id) + .orderBy(desc(tables.scores.total)) .all() setResponseStatus(event, 200)