diff --git a/app/components/flow/doctor/list.vue b/app/components/flow/doctor/list.vue index c6007660..8615a5a1 100644 --- a/app/components/flow/doctor/list.vue +++ b/app/components/flow/doctor/list.vue @@ -15,6 +15,10 @@ const refSearchNav: RefSearchNav = { }, } +const isLoading = reactive({ + dataListLoading: false, +}) + const recId = ref(0) const recAction = ref('') const recItem = ref(null) @@ -28,13 +32,16 @@ const headerPrep: HeaderPrep = { }, } -useAsyncData('getDoctor', () => xfetch('/api/v1/doctor'), { server: false, immediate: true }) async function getDoctorList() { + isLoading.dataListLoading = true + const resp = await xfetch('/api/v1/doctor') if (resp.success) { data.value = (resp.body as Record).data } + + isLoading.dataListLoading = false } onMounted(() => { @@ -44,9 +51,10 @@ onMounted(() => { provide('rec_id', recId) provide('rec_action', recAction) provide('rec_item', recItem) +provide('pull_data', isLoading) diff --git a/app/components/flow/patient/list.vue b/app/components/flow/patient/list.vue index 3131d81d..4eee1912 100644 --- a/app/components/flow/patient/list.vue +++ b/app/components/flow/patient/list.vue @@ -20,8 +20,9 @@ const refSearchNav: RefSearchNav = { // Loading state management const isLoading = reactive({ summary: false, - table: false, + dataListLoading: false, }) + const recId = ref(0) const recAction = ref('') const recItem = ref(null) @@ -82,11 +83,13 @@ async function getPatientSummary() { } async function getPatientList() { + isLoading.dataListLoading = true const resp = await xfetch('/api/v1/patient') console.log('data patient', resp) if (resp.success) { data.value = (resp.body as Record).data } + isLoading.dataListLoading = false } onMounted(() => { @@ -97,6 +100,7 @@ onMounted(() => { provide('rec_id', recId) provide('rec_action', recAction) provide('rec_item', recItem) +provide('pull_data', isLoading)