From aec4e512dc8b15d0d39cc1e11d10bb1fe15a29d2 Mon Sep 17 00:00:00 2001 From: khavinshankar Date: Fri, 20 Oct 2023 09:00:09 +0530 Subject: [PATCH] added debug statements --- src/utils/dailyRoundUtils.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/utils/dailyRoundUtils.js b/src/utils/dailyRoundUtils.js index f2d7527..31d4e86 100644 --- a/src/utils/dailyRoundUtils.js +++ b/src/utils/dailyRoundUtils.js @@ -20,13 +20,19 @@ export const getAsset = async (assetIp) => { } export const getPatientId = async (assetExternalId) => { - return await axios.get(`${careApi}/api/v1/consultation/patient_from_asset/`, - { headers: await generateHeaders(assetExternalId) } - ).then(res => res.data).catch(err => { - console.log("[Daily Round] vvv") - console.log(err?.response?.data) - return {} - }) + return await axios + .get(`${careApi}/api/v1/consultation/patient_from_asset/`, { + headers: await generateHeaders(assetExternalId), + }) + .then((res) => res.data) + .catch((err) => { + console.log( + "[Daily Round] Failed to fetch patient_id from care", + err.message + ); + console.log(err?.response?.status, err?.response?.data); + return {}; + }); } // export const getAssetsByBedId = async (bedId) => {