File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ import { getCanonicalUserUrl } from '@/utils/urls'
66import { Metadata } from 'next'
77import { db , sql } from '@nextjs-forum/db/node'
88import { notFound } from 'next/navigation'
9+
10+ export const revalidate = 60
11+ export const dynamic = 'error'
12+
913const getLeaderboardPosition = async ( discordID : string ) => {
1014 const result = await db
1115 . with ( 'rankedUsers' , ( db ) =>
@@ -54,8 +58,9 @@ const getUserPosts = async (discordID: string) => {
5458 const posts = await db
5559 . selectFrom ( 'posts' )
5660 . innerJoin ( 'messages' , 'posts.answerId' , 'messages.snowflakeId' )
57- . select ( [ 'posts.id' ] ) // Select more as needed
61+ . select ( [ 'posts.id' ] )
5862 . where ( 'messages.userId' , '=' , discordID )
63+ . orderBy ( 'posts.createdAt' , 'desc' )
5964 . limit ( 5 )
6065 . execute ( )
6166
@@ -86,6 +91,7 @@ const getUserPosts = async (discordID: string) => {
8691 . where ( 'messages.snowflakeId' , '!=' , eb . ref ( 'posts.snowflakeId' ) )
8792 . as ( 'messagesCount' ) as any , // Ensure the return type matches AliasedSelectQueryBuilder
8893 ] )
94+ . orderBy ( 'posts.createdAt' , 'desc' )
8995 . execute ( )
9096
9197 return detailedPosts
Original file line number Diff line number Diff line change 33/// <reference types="next/navigation-types/compat/navigation" />
44
55// NOTE: This file should not be edited
6- // see https://nextjs.org/docs/basic-features /typescript for more information.
6+ // see https://nextjs.org/docs/app/building-your-application/configuring /typescript for more information.
You can’t perform that action at this time.
0 commit comments