From f1d1fc4f52712e484bb7b69c36cbf5fe74997191 Mon Sep 17 00:00:00 2001 From: Leonardo Matos Date: Tue, 17 Sep 2024 01:56:54 -0300 Subject: [PATCH] fix: fix handling tag creation response (id) from freteclick api --- functions/routes/ecom/webhook.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/routes/ecom/webhook.js b/functions/routes/ecom/webhook.js index 8c6d352..03c48c9 100644 --- a/functions/routes/ecom/webhook.js +++ b/functions/routes/ecom/webhook.js @@ -48,7 +48,7 @@ exports.post = ({ appSdk }, req, res) => { const data = await createTag(order, storeId, appData, appSdk) logger.info(`Tag created for #${storeId} ${orderId}`, { data }) trackingCodes.push({ - code: data.id, + code: data['@id'] || data.id, link: 'https://www.freteclick.com.br/rastreamento', tag: 'freteclick' })