|
|
@ -81,20 +81,26 @@ export async function hookTest(param: { |
|
|
|
|
|
|
|
|
|
|
|
const model = await Model.getByIdOrName({ id: param.tableId }); |
|
|
|
const model = await Model.getByIdOrName({ id: param.tableId }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
T.emit('evt', { evt_type: 'webhooks:tested' }); |
|
|
|
|
|
|
|
|
|
|
|
const { |
|
|
|
const { |
|
|
|
hook, |
|
|
|
hook, |
|
|
|
payload: { data, user }, |
|
|
|
payload: { data, user }, |
|
|
|
} = param.hookTest; |
|
|
|
} = param.hookTest; |
|
|
|
await invokeWebhook( |
|
|
|
try { |
|
|
|
new Hook(hook), |
|
|
|
await invokeWebhook( |
|
|
|
model, |
|
|
|
new Hook(hook), |
|
|
|
data, |
|
|
|
model, |
|
|
|
user, |
|
|
|
null, |
|
|
|
(hook as any)?.filters, |
|
|
|
null, |
|
|
|
true |
|
|
|
data, |
|
|
|
); |
|
|
|
user, |
|
|
|
|
|
|
|
(hook as any)?.filters, |
|
|
|
T.emit('evt', { evt_type: 'webhooks:tested' }); |
|
|
|
true |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
throw e; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|