File tree Expand file tree Collapse file tree 1 file changed +12
-16
lines changed Expand file tree Collapse file tree 1 file changed +12
-16
lines changed Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments