Reconcile validated Turso runtime fix with republished main history

Hop-State: A_06FP6A2CG8PVBRDVQ5WGCN0
Hop-Proposal: R_06FP6A0YW23RY0N7Z5M8DW0
Hop-Task: T_06FP67JVF4BHPYKKC37XKQ8
Hop-Attempt: AT_06FP69RZ96ZMNF9Y5S02MT0
This commit is contained in:
2026-07-14 17:23:33 -07:00
committed by Hop
20 changed files with 65 additions and 41 deletions
@@ -23,10 +23,10 @@ export async function GET(request: NextRequest) {
// Get all conversations for this user
const conversations = await db.query.chatConversations.findMany({
where: { participant1Id: session.user.id },
orderBy: () => [desc(chatConversations.lastMessageAt)],
orderBy: (chatConversations, { desc }) => [desc(chatConversations.lastMessageAt)],
with: {
messages: {
orderBy: () => [desc(chatMessages.createdAt)],
orderBy: (chatMessages, { desc }) => [desc(chatMessages.createdAt)],
limit: 1,
},
},
+1 -1
View File
@@ -67,7 +67,7 @@ export async function GET(request: NextRequest) {
// Get messages
const messages = await db.query.chatMessages.findMany({
where: whereCondition,
orderBy: () => [desc(chatMessages.createdAt)],
orderBy: (chatMessages, { desc }) => [desc(chatMessages.createdAt)],
limit,
});
+1 -1
View File
@@ -109,7 +109,7 @@ export async function GET(request: NextRequest, context: RouteContext) {
author: true,
media: true,
},
orderBy: () => [desc(posts.createdAt)],
orderBy: (posts, { desc }) => [desc(posts.createdAt)],
limit: 50,
});
+2 -2
View File
@@ -224,13 +224,13 @@ export async function GET(request: NextRequest, context: RouteContext) {
const localPosts = await db.query.posts.findMany({
where: { AND: [{ userId: user.id }, { isRemoved: false }, { replyToId: { isNull: true } }, { swarmReplyToId: { isNull: true } }] },
with: profilePostRelations,
orderBy: () => [desc(posts.createdAt)],
orderBy: (posts, { desc }) => [desc(posts.createdAt)],
limit: limit * 2,
});
const remoteRepostRows = await db.query.userSwarmReposts.findMany({
where: { userId: user.id },
orderBy: () => [desc(userSwarmReposts.repostedAt)],
orderBy: (userSwarmReposts, { desc }) => [desc(userSwarmReposts.repostedAt)],
limit: limit * 2,
});