Added option to overwrite webhook payload
This commit is contained in:
parent
f08cf1286d
commit
628097a1d8
1 changed files with 8 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue