diff --git a/src/app/_components/sidebar/most-active-users.tsx b/src/app/_components/sidebar/most-active-users.tsx index 9c99057..c48f4be 100644 --- a/src/app/_components/sidebar/most-active-users.tsx +++ b/src/app/_components/sidebar/most-active-users.tsx @@ -23,7 +23,7 @@ export function MostActiveUsers({
    - {data.map(({ user }, index) => ( + {data.map(({ user, score }, index) => (
  1. {index + 1}. @@ -41,7 +41,7 @@ export function MostActiveUsers({ }} /> -
    +
    +

    + {score} +

  2. ))}
diff --git a/src/server/api/routers/user.ts b/src/server/api/routers/user.ts index ba29fa9..442b411 100644 --- a/src/server/api/routers/user.ts +++ b/src/server/api/routers/user.ts @@ -190,6 +190,7 @@ export const userRouter = createTRPCRouter({ const data = await ctx.db .select({ user: users, + score, }) .from(users) .leftJoin(questions, eq(questions.userId, users.id)) @@ -219,11 +220,13 @@ export const userRouter = createTRPCRouter({ gt(memberships.expiresAt, new Date()), ), ); + return data.map((dt) => ({ user: { ...dt.user, membership: _memberships.find((mb) => mb.userId === dt.user.id), }, + score: dt.score, })); }), });