1
0
Fork 0
mirror of synced 2024-06-29 19:50:26 +12:00

Added option to overwrite webhook payload

This commit is contained in:
Eldad Fux 2020-09-10 09:52:32 +03:00
parent f08cf1286d
commit 628097a1d8

View file

@ -274,12 +274,18 @@ App::shutdown(function ($utopia, $request, $response, $project, $webhooks, $audi
/** @var bool $mode */
if (!empty($functions->getParam('event'))) {
$functions->setParam('payload', $response->getPayload());
if(empty($functions->getParam('payload'))) {
$functions->setParam('payload', $response->getPayload());
}
$functions->trigger();
}
if (!empty($webhooks->getParam('event'))) {
$webhooks->setParam('payload', $response->getPayload());
if(empty($webhooks->getParam('payload'))) {
$webhooks->setParam('payload', $response->getPayload());
}
$webhooks->trigger();
}