2
0

fix(engine): 🐛 Standalone '?' when no query params

This commit is contained in:
Baptiste Arnaud
2022-03-01 15:01:27 +01:00
parent ae347eeb53
commit d6c3e8d41a
2 changed files with 9 additions and 3 deletions

View File

@ -207,8 +207,12 @@ const executeWebhook = async (
resultValues,
},
})
const statusCode = (data as Record<string, string>).statusCode.toString()
const isError = statusCode.startsWith('4') || statusCode.startsWith('5')
const statusCode = (
data as Record<string, string> | undefined
)?.statusCode.toString()
const isError = statusCode
? statusCode?.startsWith('4') || statusCode?.startsWith('5')
: true
onNewLog({
status: error ? 'error' : isError ? 'warning' : 'success',
description: isError