fix: update list medicine
This commit is contained in:
@@ -30,7 +30,7 @@ import {
|
||||
} from '~/handlers/medicine-method.handler'
|
||||
|
||||
// Services
|
||||
import { getMedicineMethods, getMedicineMethodDetail } from '~/services/medicine-method.service'
|
||||
import { getList, getDetail } from '~/services/medicine-method.service'
|
||||
|
||||
const title = ref('')
|
||||
|
||||
@@ -44,7 +44,11 @@ const {
|
||||
fetchData: getMedicineMethodList,
|
||||
} = usePaginatedList({
|
||||
fetchFn: async (params: any) => {
|
||||
const result = await getMedicineMethods({ search: params.search, page: params['page-number'] || 0 })
|
||||
const result = await getList({
|
||||
search: params.search,
|
||||
'page-number': params['page-number'] || 0,
|
||||
'page-size': params['page-size'] || 10,
|
||||
})
|
||||
return { success: result.success || false, body: result.body || {} }
|
||||
},
|
||||
entityName: 'medicine-method',
|
||||
@@ -82,7 +86,7 @@ provide('rec_item', recItem)
|
||||
provide('table_data_loader', isLoading)
|
||||
|
||||
const getCurrentMedicineMethodDetail = async (id: number | string) => {
|
||||
const result = await getMedicineMethodDetail(id)
|
||||
const result = await getDetail(id)
|
||||
if (result.success) {
|
||||
const currentValue = result.body?.data || {}
|
||||
recItem.value = currentValue
|
||||
|
||||
Reference in New Issue
Block a user