From a71c651c2bd13cc3ac1faac17fea859de819495a Mon Sep 17 00:00:00 2001 From: Rugute Date: Tue, 19 Mar 2024 14:12:22 +0300 Subject: [PATCH] Added basicAuthBase64 in pre-appointment --- .../src/pre-appointments/pre-appointment.resource.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/esm-preappointment-app/src/pre-appointments/pre-appointment.resource.tsx b/packages/esm-preappointment-app/src/pre-appointments/pre-appointment.resource.tsx index 9df33d60..8a20eef4 100644 --- a/packages/esm-preappointment-app/src/pre-appointments/pre-appointment.resource.tsx +++ b/packages/esm-preappointment-app/src/pre-appointments/pre-appointment.resource.tsx @@ -1,9 +1,11 @@ import useSWR from 'swr'; import { Buffer } from 'buffer'; +import { useConfig } from '@openmrs/esm-framework'; const moment = require('moment'); const username = ''; const password = ''; -const basicAuthBase64 = Buffer.from(`${username}:${password}`).toString('base64'); +const { basicAuthBase64 } = useConfig(); +//const basicAuthBase644 = Buffer.from(`${username}:${password}`).toString('base64'); interface YearWeek { id: string; @@ -28,6 +30,7 @@ export const usePreAppointments = (locationUuid: string, yearWeek: any, successC let url = `https://ngx.ampath.or.ke/etl-latest/etl/ml-weekly-predictions?locationUuids=${locationUuid}&yearWeek=${yearWeek?.id}`; if (successCode.id !== '' && successCode) { url += successCode.id; + alert('text'); } const { data, error, isLoading, isValidating } = useSWR(url, fetcher);