File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
builder/src/features/forge/api
viewer/src/app/api/integrations/openai/streamer Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -94,9 +94,9 @@ export const fetchSelectItems = authenticatedProcedure
9494 )
9595 : undefined ;
9696
97- const handler = forgedBlockHandlers [ input . integrationId ] . find (
97+ const handler = forgedBlockHandlers [ input . integrationId ] ? .find (
9898 ( handler ) => handler . type === "fetcher" && handler . id === input . fetcherId ,
99- ) as FetcherHandler ;
99+ ) as FetcherHandler | undefined ;
100100
101101 if ( ! handler ) return { items : [ ] } ;
102102
Original file line number Diff line number Diff line change @@ -126,9 +126,9 @@ export async function POST(req: Request) {
126126 { status : 400 , headers : responseHeaders } ,
127127 ) ;
128128
129- const handler = forgedBlockHandlers [ block . type ] . find (
129+ const handler = forgedBlockHandlers [ block . type ] ? .find (
130130 ( h ) => h . type === "action" && h . actionName === block . options ?. action ,
131- ) as ActionHandler ;
131+ ) as ActionHandler | undefined ;
132132
133133 if ( ! handler || ! handler . stream )
134134 return NextResponse . json (
Original file line number Diff line number Diff line change @@ -103,9 +103,9 @@ export const getMessageStream = async ({
103103 message : "This block does not have a stream function" ,
104104 } ;
105105
106- const handler = forgedBlockHandlers [ block . type ] . find (
106+ const handler = forgedBlockHandlers [ block . type ] ? .find (
107107 ( h ) => h . type === "action" && h . actionName === block . options ?. action ,
108- ) as ActionHandler ;
108+ ) as ActionHandler | undefined ;
109109
110110 if ( ! handler || ! handler . stream )
111111 return {
Original file line number Diff line number Diff line change @@ -34,9 +34,9 @@ export const executeForgedBlock = async (
3434 const blockDef = forgedBlocks [ block . type ] ;
3535 if ( ! blockDef ) return { outgoingEdgeId : block . outgoingEdgeId } ;
3636 const action = blockDef . actions . find ( ( a ) => a . name === block . options ?. action ) ;
37- const handler = forgedBlockHandlers [ block . type ] . find (
37+ const handler = forgedBlockHandlers [ block . type ] ? .find (
3838 ( h ) => h . type === "action" && h . actionName === action ?. name ,
39- ) as ActionHandler ;
39+ ) as ActionHandler | undefined ;
4040 if ( ! block . options || ! handler || ! action )
4141 return {
4242 outgoingEdgeId : block . outgoingEdgeId ,
You can’t perform that action at this time.
0 commit comments