From caa1dfaf34541325236d234f26d1f78bab91550e Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Wed, 7 Feb 2024 22:04:40 +0530 Subject: [PATCH] changed callwwebhook --- .../src/Component/PdfRequestFiles.js | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js b/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js index 924c7c5c1..53c45f0df 100644 --- a/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js +++ b/microfrontends/SignDocuments/src/Component/PdfRequestFiles.js @@ -612,6 +612,10 @@ function PdfRequestFiles() { .then(async (result) => { const res = result.data; if (res) { + const currentDecline = { + currnt: "YouDeclined", + isDeclined: true + }; const params = { event: "declined", body: { @@ -628,24 +632,23 @@ function PdfRequestFiles() { declinedAt: new Date() } }; - const res = await axios.post( - `${localStorage.getItem("baseUrl")}functions/callwebhook`, - params, - { - headers: { - "Content-Type": "application/json", - "X-Parse-Application-Id": localStorage.getItem("parseAppId"), - sessiontoken: localStorage.getItem("accesstoken") - } - } - ); - console.log("res ", res.data); - const currentDecline = { - currnt: "YouDeclined", - isDeclined: true - }; setIsDecline(currentDecline); setIsUiLoading(false); + try { + await axios.post( + `${localStorage.getItem("baseUrl")}functions/callwebhook`, + params, + { + headers: { + "Content-Type": "application/json", + "X-Parse-Application-Id": localStorage.getItem("parseAppId"), + sessiontoken: localStorage.getItem("accesstoken") + } + } + ); + } catch (err) { + console.log("Err ", err); + } } }) .catch((err) => {