mirror of
https://github.com/documenso/documenso
synced 2026-04-21 13:27:18 +00:00
fix: unwrap webhook payload before test and resend
This commit is contained in:
parent
198dafc8ec
commit
01c68a63f2
2 changed files with 11 additions and 2 deletions
|
|
@ -32,7 +32,7 @@ export const triggerTestWebhook = async ({
|
|||
try {
|
||||
await triggerWebhook({
|
||||
event,
|
||||
data: samplePayload,
|
||||
data: samplePayload.payload,
|
||||
userId,
|
||||
teamId,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -39,12 +39,21 @@ export const resendWebhookCallRoute = authenticatedProcedure
|
|||
throw new AppError(AppErrorCode.NOT_FOUND);
|
||||
}
|
||||
|
||||
const requestBody = webhookCall.requestBody;
|
||||
const data =
|
||||
requestBody &&
|
||||
typeof requestBody === 'object' &&
|
||||
!Array.isArray(requestBody) &&
|
||||
'payload' in requestBody
|
||||
? requestBody.payload
|
||||
: requestBody;
|
||||
|
||||
await jobs.triggerJob({
|
||||
name: 'internal.execute-webhook',
|
||||
payload: {
|
||||
event: webhookCall.event,
|
||||
webhookId,
|
||||
data: webhookCall.requestBody,
|
||||
data,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue