fix: includes for unit

This commit is contained in:
riefive
2025-10-01 15:24:54 +07:00
parent db48233f6c
commit 546423bdfb
3 changed files with 5 additions and 4 deletions

No files matched your search

+3 -2
View File
@@ -28,8 +28,9 @@ export const funcParsed: RecStrFuncUnknown = {
const recX = rec as SmallDetailDto const recX = rec as SmallDetailDto
return `${recX.name}`.trim() return `${recX.name}`.trim()
}, },
installation: (_rec: unknown): unknown => { installation: (rec: unknown): unknown => {
return '-' const recX = rec as SmallDetailDto
return recX.installation?.name || '-'
}, },
} }
+1 -1
View File
@@ -45,7 +45,7 @@ const {
fetchData: getUnitList, fetchData: getUnitList,
} = usePaginatedList({ } = usePaginatedList({
fetchFn: async (params: any) => { fetchFn: async (params: any) => {
const result = await getUnits({ search: params.search, page: params['page-number'] || 0 }) const result = await getUnits({ search: params.search, page: params['page-number'] || 0, includes: 'installation' })
return { success: result.success || false, body: result.body || {} } return { success: result.success || false, body: result.body || {} }
}, },
entityName: 'unit', entityName: 'unit',
+1 -1
View File
@@ -50,7 +50,7 @@ export const getEncounterClassList = async () => {
const result = await getEncounters() const result = await getEncounters()
if (result.success) { if (result.success) {
const currentValues = result.body?.data || [] const currentValues = result.body?.data || []
encounterClasses.value = currentValues.map((item: any) => ({ value: item.code || item.id, label: item.name })) encounterClasses.value = currentValues.map((item: any) => ({ value: item.class_code || item.id, label: item.class_code }))
} }
} }