Skip to content

Commit

Permalink
fix(webhook-ecom): check if the trigger has a body
Browse files Browse the repository at this point in the history
  • Loading branch information
wisley7l committed Jan 10, 2024
1 parent 93508bd commit 0ad857a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functions/routes/ecom/webhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ exports.post = async ({ appSdk, admin }, req, res) => {
})
})
} else if (
trigger.resource === 'orders' && trigger.body.status &&
trigger.resource === 'orders' && trigger.body && trigger.body.status &&
trigger.body.status !== 'cancelled' && trigger.action !== 'create' &&
trigger.fields.includes('items')
trigger.fields?.includes('items')
) {
console.log('>> ', JSON.stringify(trigger))
// When the original order is edited
Expand Down

0 comments on commit 0ad857a

Please sign in to comment.