From d3090d04ef16e36824c4fd2d7ffe80168733f71b Mon Sep 17 00:00:00 2001 From: Khafid Prayoga Date: Fri, 31 Oct 2025 13:34:45 +0700 Subject: [PATCH] feat(specialist): add unit info to specialist detail view - Extend getDetail function to accept optional params - Include unit data when fetching specialist details - Display unit code alongside name in detail view --- app/components/app/specialist/detail/index.vue | 4 +++- app/components/content/specialist/detail.vue | 4 +++- app/services/specialist.service.ts | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/components/app/specialist/detail/index.vue b/app/components/app/specialist/detail/index.vue index faa5234c..3f32a78f 100644 --- a/app/components/app/specialist/detail/index.vue +++ b/app/components/app/specialist/detail/index.vue @@ -29,7 +29,9 @@ defineProps<{ diff --git a/app/components/content/specialist/detail.vue b/app/components/content/specialist/detail.vue index 7387900d..df4e79b6 100644 --- a/app/components/content/specialist/detail.vue +++ b/app/components/content/specialist/detail.vue @@ -117,7 +117,9 @@ const headerPrep: HeaderPrep = { // #region Lifecycle Hooks onMounted(async () => { try { - const result = await getDetailSpecialist(props.specialistId) + const result = await getDetailSpecialist(props.specialistId, { + includes: 'unit', + }) if (result.success) { specialist.value = result.body.data || {} } diff --git a/app/services/specialist.service.ts b/app/services/specialist.service.ts index c2c34e3f..ee955421 100644 --- a/app/services/specialist.service.ts +++ b/app/services/specialist.service.ts @@ -15,8 +15,8 @@ export function getList(params: any = null) { return base.getList(path, params, name) } -export function getDetail(id: number | string) { - return base.getDetail(path, id, name) +export function getDetail(id: number | string, params?: any) { + return base.getDetail(path, id, name, params) } export function update(id: number | string, data: any) {