File tree Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -5,18 +5,21 @@ export async function POST(request: Request) {
55 // In production validation of the request body might be necessary.
66 const body = await request . json ( ) ;
77
8- const replyRes = await plainClient . replyToThread ( { textContent : body . message , threadId : body . threadId } )
9- if ( replyRes . error ) {
10- console . error (
11- inspect ( replyRes . error , {
12- showHidden : false ,
13- depth : null ,
14- colors : true ,
15- } )
16- ) ;
17- return new Response ( replyRes . error . message , { status : 500 } ) ;
18- }
8+ const replyRes = await plainClient . replyToThread ( {
9+ textContent : body . message ,
10+ threadId : body . threadId ,
11+ } ) ;
12+ if ( replyRes . error ) {
13+ console . error (
14+ inspect ( replyRes . error , {
15+ showHidden : false ,
16+ depth : null ,
17+ colors : true ,
18+ } )
19+ ) ;
20+ return new Response ( replyRes . error . message , { status : 500 } ) ;
21+ }
1922
20- console . log ( ' Replied to thread' , body . threadId ) ;
21- return new Response ( "" , { status : 200 } ) ;
22- }
23+ console . log ( " Replied to thread" , body . threadId ) ;
24+ return new Response ( "" , { status : 200 } ) ;
25+ }
You can’t perform that action at this time.
0 commit comments