Skip to content

Commit 9d33494

Browse files
committed
remove try catch
1 parent 7869f75 commit 9d33494

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

docs/_partials/create-invitation.mdx

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,19 @@
55
import { NextResponse } from 'next/server'
66

77
export async function POST() {
8-
try {
9-
const client = await clerkClient()
10-
const invitation = await client.invitations.createInvitation({
11-
emailAddress: 'invite@example.com',
12-
redirectUrl: 'https://www.example.com/my-sign-up',
13-
publicMetadata: {
14-
example: 'metadata',
15-
example_nested: {
16-
nested: 'metadata',
17-
},
8+
const client = await clerkClient()
9+
const invitation = await client.invitations.createInvitation({
10+
emailAddress: 'invite@example.com',
11+
redirectUrl: 'https://www.example.com/my-sign-up',
12+
publicMetadata: {
13+
example: 'metadata',
14+
example_nested: {
15+
nested: 'metadata',
1816
},
19-
})
20-
return NextResponse.json({ message: 'Invitation created', invitation })
21-
} catch (error) {
22-
console.log(error)
23-
return NextResponse.json({ error: 'Error creating invitation' })
24-
}
17+
},
18+
})
19+
20+
return NextResponse.json({ message: 'Invitation created', invitation })
2521
}
2622
```
2723
</Tab>

0 commit comments

Comments
 (0)