From 4f8407f978a7930b07ea95679c6e6a40a96df2a6 Mon Sep 17 00:00:00 2001 From: Abizrh Date: Fri, 21 Nov 2025 15:43:27 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20(cprj):=20fix=20encounter-?= =?UTF-8?q?id=20prop=20for=20getlist=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/content/cprj/list.vue | 4 +++- app/components/content/soapi/list.vue | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/components/content/cprj/list.vue b/app/components/content/cprj/list.vue index 3ad22d6a..6da61716 100644 --- a/app/components/content/cprj/list.vue +++ b/app/components/content/cprj/list.vue @@ -41,6 +41,7 @@ interface Props { } const props = defineProps() const emits = defineEmits(['add', 'edit']) +const route = useRoute() const { recordId } = useQueryCRUDRecordId() const { goToEntry, backToList } = useQueryCRUDMode('mode') @@ -48,6 +49,7 @@ const { goToEntry, backToList } = useQueryCRUDMode('mode') let units = ref<{ value: string; label: string }[]>([]) const encounterId = ref(props?.encounter?.id || 0) const title = ref('') +const id = route.params.id const { data, @@ -60,7 +62,7 @@ const { } = usePaginatedList({ fetchFn: async ({ page, search }) => { const result = await getList({ - 'encounter-id': props.encounter.id, + 'encounter-id': id, 'type-code': 'dev-record', includes: 'encounter', search, diff --git a/app/components/content/soapi/list.vue b/app/components/content/soapi/list.vue index bc2a39d0..00f2a5ad 100644 --- a/app/components/content/soapi/list.vue +++ b/app/components/content/soapi/list.vue @@ -71,7 +71,7 @@ onMounted(async () => { }) async function getMyList() { - const url = `/api/v1/soapi?type-code=${typeCode.value}?includes=encounter` + const url = `/api/v1/soapi?type-code=${typeCode.value}&includes=encounter&encounter-id=${route.params.id}` const resp = await xfetch(url) if (resp.success) { data.value = (resp.body as Record).data @@ -103,7 +103,7 @@ watch( (val) => { if (val) { if (val === 'early-medical-assessment') { - typeCode.value = 'early' + typeCode.value = 'early-medic' } else if (val === 'rehab-medical-assessment') { typeCode.value = 'early-rehab' } else if (val === 'function-assessment') {