Skip to content

Commit

Permalink
chore: test for webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusgnreis committed Jan 22, 2024
1 parent 79754c9 commit 7e655c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion functions/routes/ecom/webhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ const removeFromQueue = (resourceId) => {
exports.post = async ({ appSdk, admin }, req, res) => {
// receiving notification from Store API
const { storeId } = req
console.log('acionando webhook', storeId, JSON.stringify(req.body))


if (req.get('host') && !baseUri.includes(req.get('host'))) {
console.log('>>> Proxy to function v2')
const axios = require('axios')
Expand Down Expand Up @@ -60,6 +61,9 @@ exports.post = async ({ appSdk, admin }, req, res) => {
*/
const trigger = req.body
const resourceId = trigger.resource_id || trigger.inserted_id
if (trigger.resource === 'applications') {
console.log('acionando webhook', storeId, JSON.stringify(req.body))
}
// get app configured options
if (!handlingIds.includes(resourceId)) {
handlingIds.push(resourceId)
Expand Down

0 comments on commit 7e655c3

Please sign in to comment.