fix(engine): 🐛 Standalone '?' when no query params
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user