@@ -251,7 +251,7 @@ function TriggersPage() {
251251 const matchesTrigger =
252252 t . id . toLowerCase ( ) . includes ( query ) || t . trigger_type . toLowerCase ( ) . includes ( query )
253253 const matchesFunction = t . function_id . toLowerCase ( ) . includes ( query )
254- const config = t . config as Record < string , unknown >
254+ const config = ( t . config ?? { } ) as Record < string , unknown >
255255 const matchesConfig =
256256 ( config . api_path && String ( config . api_path ) . toLowerCase ( ) . includes ( query ) ) ||
257257 ( config . topic && String ( config . topic ) . toLowerCase ( ) . includes ( query ) ) ||
@@ -392,7 +392,7 @@ function TriggersPage() {
392392 }
393393
394394 const getTriggerSummary = ( trigger : TriggerInfo ) : string => {
395- const config = trigger . config as Record < string , unknown >
395+ const config = ( trigger . config ?? { } ) as Record < string , unknown >
396396 switch ( trigger . trigger_type ) {
397397 case 'http' : {
398398 const method = ( config . http_method as string ) || 'GET'
@@ -418,7 +418,7 @@ function TriggersPage() {
418418 dispatchInvoke ( { type : 'CLEAR_RESULT' } )
419419
420420 if ( trigger . trigger_type === 'http' ) {
421- const config = trigger . config as { api_path ?: string ; http_method ?: string }
421+ const config = ( trigger . config ?? { } ) as { api_path ?: string ; http_method ?: string }
422422 const method = config . http_method || 'GET'
423423 const path = config . api_path || ''
424424 const matches = path . match ( / : ( [ a - z A - Z _ ] + ) / g)
@@ -441,7 +441,7 @@ function TriggersPage() {
441441 }
442442
443443 const invokeHttp = async ( trigger : TriggerInfo ) => {
444- const config = trigger . config as { api_path ?: string ; http_method ?: string }
444+ const config = ( trigger . config ?? { } ) as { api_path ?: string ; http_method ?: string }
445445 let path = ( config . api_path || '' ) . replace ( / ^ \/ / , '' )
446446 const method = httpMethod || config . http_method || 'GET'
447447
@@ -553,7 +553,7 @@ function TriggersPage() {
553553 }
554554
555555 const invokeEvent = async ( trigger : TriggerInfo ) => {
556- const config = trigger . config as { topic ?: string }
556+ const config = ( trigger . config ?? { } ) as { topic ?: string }
557557 const topic = config . topic || ''
558558 dispatchInvoke ( { type : 'START_INVOKE' } )
559559 try {
@@ -891,7 +891,7 @@ function TriggersPage() {
891891 { /* HTTP Trigger Detail */ }
892892 { selectedTrigger . trigger_type === 'http' &&
893893 ( ( ) => {
894- const config = selectedTrigger . config as {
894+ const config = ( selectedTrigger . config ?? { } ) as {
895895 api_path ?: string
896896 http_method ?: string
897897 }
@@ -1096,7 +1096,7 @@ function TriggersPage() {
10961096 { /* Cron Trigger Detail */ }
10971097 { selectedTrigger . trigger_type === 'cron' &&
10981098 ( ( ) => {
1099- const config = selectedTrigger . config as {
1099+ const config = ( selectedTrigger . config ?? { } ) as {
11001100 expression ?: string
11011101 description ?: string
11021102 }
@@ -1194,7 +1194,10 @@ function TriggersPage() {
11941194 { /* Event Trigger Detail */ }
11951195 { selectedTrigger . trigger_type === 'event' &&
11961196 ( ( ) => {
1197- const config = selectedTrigger . config as { topic ?: string ; description ?: string }
1197+ const config = ( selectedTrigger . config ?? { } ) as {
1198+ topic ?: string
1199+ description ?: string
1200+ }
11981201 const topic = config . topic || 'Unknown'
11991202
12001203 return (
0 commit comments