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

@@ -95,7 +95,9 @@ const executeWebhook =
}) })
try { try {
const response = await got( const response = await got(
parseVariables(variables)(webhook.url + `?${queryParams}`), parseVariables(variables)(
webhook.url + (queryParams !== '' ? `?${queryParams}` : '')
),
{ {
method: webhook.method as Method, method: webhook.method as Method,
headers, headers,

View File

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