Skip to content

Commit

Permalink
feat(webhook): log message
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnvdbrug committed Feb 6, 2025
1 parent a01e025 commit 70f5ad2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/vendure-plugin-webhook/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.4.1 (2025-02-06)

- Log info message when event is ignored because transformer returned 'false'

# 1.4.0 (2025-02-06)

- Allow cancelling webhook by returning `false` in request transformers
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-webhook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-webhook",
"version": "1.4.0",
"version": "1.4.1",
"description": "Call webhooks based on configured events from Vendure",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
4 changes: 4 additions & 0 deletions packages/vendure-plugin-webhook/src/api/webhook.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ export class WebhookService implements OnApplicationBootstrap {
);
if (request === false) {
// Don't call webhook if transformer returns false
Logger.info(
`Ignoring event ${event.constructor.name} for channel ${webhook.channelId} because transformer "${webhook.transformerName}" returned false`,
loggerCtx
);
return;
}
// Call the webhook with the constructed request
Expand Down

0 comments on commit 70f5ad2

Please sign in to comment.