Skip to content

Commit

Permalink
fix: Step 7 & 8 of Neon integration guide (#1552)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeguillen authored and royanger committed Oct 8, 2024
1 parent 157cf1a commit dd3e8ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/integrations/databases/neon.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ This tutorial demonstrates how to integrate Neon Postgres with Clerk in a Next.j

const message = formData.get('message') as string
await db.insert(UserMessages).values({
user_id: user.id,
user_id: userId,
message,
})
}
Expand All @@ -166,7 +166,7 @@ This tutorial demonstrates how to integrate Neon Postgres with Clerk in a Next.j
const { userId } = auth()
if (!userId) throw new Error('User not found')

await db.delete(UserMessages).where(eq(UserMessages.user_id, user.id))
await db.delete(UserMessages).where(eq(UserMessages.user_id, userId))
}
```

Expand All @@ -186,7 +186,7 @@ This tutorial demonstrates how to integrate Neon Postgres with Clerk in a Next.j
export default async function Home() {
const { userId } = auth()
if (!userId) throw new Error('User not found')
const existingMessage = db.query.UserMessages.findFirst({
const existingMessage = await db.query.UserMessages.findFirst({
where: (messages, { eq }) => eq(messages.user_id, userId),
})

Expand Down

0 comments on commit dd3e8ab

Please sign in to comment.