From 42c4185791fb4e64ae5ecb1739defe2750a5aef3 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 27 May 2024 12:33:46 -0300 Subject: [PATCH 1/3] add try catch validation --- .../add-or-update-contact/add-or-update-contact.mjs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/components/brevo/actions/add-or-update-contact/add-or-update-contact.mjs b/components/brevo/actions/add-or-update-contact/add-or-update-contact.mjs index 1b5dd64beeb6b..8a8b5a6f16f1c 100644 --- a/components/brevo/actions/add-or-update-contact/add-or-update-contact.mjs +++ b/components/brevo/actions/add-or-update-contact/add-or-update-contact.mjs @@ -55,10 +55,13 @@ export default { const listIds = Object.keys(this.listIds).map((key) => parseInt(this.listIds[key], 10)); let contact = null; if (identifier) { - contact = await this.brevo.existingContactByIdentifier( - $, - encodeURIComponent(identifier), - ); + try { + contact = await this.brevo.existingContactByIdentifier( + encodeURIComponent(identifier), + ); + } catch (e) { + contact = null; + } } const attributes = { From 98cbed1d8c2ef1571dd8d5684a37ed84d5a4607c Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 27 May 2024 12:35:49 -0300 Subject: [PATCH 2/3] update version --- .../actions/add-or-update-contact/add-or-update-contact.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/brevo/actions/add-or-update-contact/add-or-update-contact.mjs b/components/brevo/actions/add-or-update-contact/add-or-update-contact.mjs index 8a8b5a6f16f1c..2bdcbdd6ab96e 100644 --- a/components/brevo/actions/add-or-update-contact/add-or-update-contact.mjs +++ b/components/brevo/actions/add-or-update-contact/add-or-update-contact.mjs @@ -4,7 +4,7 @@ export default { key: "brevo-add-or-update-contact", name: "Add or Update a contact", description: "Add or Update a contact", - version: "0.0.1", + version: "0.0.2", type: "action", props: { brevo, From d4cdfdf601c92b3752a0d858927d91b5920c726a Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 27 May 2024 12:38:20 -0300 Subject: [PATCH 3/3] update package.json version --- components/brevo/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/brevo/package.json b/components/brevo/package.json index 09eece9d1bbee..d68082ac1ce16 100644 --- a/components/brevo/package.json +++ b/components/brevo/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/brevo", - "version": "0.1.0", + "version": "0.1.1", "description": "Pipedream Brevo Components", "main": "brevo.app.mjs", "keywords": [