fix: update content list of specialist, subspecialist, etc
This commit is contained in:
No files matched your search
@@ -28,11 +28,12 @@ import {
|
||||
handleActionRemove,
|
||||
handleCancelForm,
|
||||
} from '~/handlers/unit.handler'
|
||||
import { installations, getInstallationList } from '~/handlers/_shared.handler'
|
||||
|
||||
// Services
|
||||
import { getUnits, getUnitDetail } from '~/services/unit.service'
|
||||
import { getList, getDetail } from '~/services/unit.service'
|
||||
import { getValueLabelList as getInstallationList } from '~/services/installation.service'
|
||||
|
||||
const installations = ref<{ value: string; label: string }[]>([])
|
||||
const title = ref('')
|
||||
|
||||
const {
|
||||
@@ -45,10 +46,10 @@ const {
|
||||
fetchData: getUnitList,
|
||||
} = usePaginatedList({
|
||||
fetchFn: async (params: any) => {
|
||||
// TODO: use pagination params
|
||||
const result = await getUnits({
|
||||
const result = await getList({
|
||||
search: params.search,
|
||||
page: params['page-number'] || 0,
|
||||
'page-number': params['page-number'] || 0,
|
||||
'page-size': params['page-size'] || 10,
|
||||
includes: 'installation',
|
||||
})
|
||||
return { success: result.success || false, body: result.body || {} }
|
||||
@@ -88,7 +89,7 @@ provide('rec_item', recItem)
|
||||
provide('table_data_loader', isLoading)
|
||||
|
||||
const getCurrentUnitDetail = async (id: number | string) => {
|
||||
const result = await getUnitDetail(id)
|
||||
const result = await getDetail(id)
|
||||
if (result.success) {
|
||||
const currentValue = result.body?.data || {}
|
||||
recItem.value = currentValue
|
||||
@@ -116,8 +117,8 @@ watch([recId, recAction], () => {
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
installations.value = await getInstallationList()
|
||||
await getUnitList()
|
||||
await getInstallationList()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user