fix: update handler for unit and uom
This commit is contained in:
No files matched your search
@@ -18,8 +18,6 @@ import { getEncounters } from '~/services/encounter.service'
|
||||
import { getDivisions } from '~/services/division.service'
|
||||
import { getInstallations } from '~/services/installation.service'
|
||||
import { getSpecialists } from '~/services/specialist.service'
|
||||
import { getUoms } from '~/services/uom.service'
|
||||
import { getUnits } from '~/services/unit.service'
|
||||
|
||||
// variables
|
||||
export const medicineGroups = ref<{ value: string; label: string }[]>([])
|
||||
@@ -110,22 +108,6 @@ export const getSpecialistsList = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
export const getUnitList = async () => {
|
||||
const result = await getUnits()
|
||||
if (result.success) {
|
||||
const currentUnits = result.body?.data || []
|
||||
units.value = currentUnits.map((item: Unit) => ({ value: item.id ? Number(item.id) : item.code, label: item.name }))
|
||||
}
|
||||
}
|
||||
|
||||
export const getUomList = async () => {
|
||||
const result = await getUoms()
|
||||
if (result.success) {
|
||||
const currentUoms = result.body?.data || []
|
||||
uoms.value = currentUoms.map((uom: Uom) => ({ value: uom.code || uom.erp_id, label: uom.name }))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert division response (with childrens) to TreeItem[]
|
||||
* @param divisions Array of division objects from API
|
||||
|
||||
Reference in New Issue
Block a user