// Handlers import { genCrudHandler } from '~/handlers/_handler' // Services import { getList, create, update, remove } from '~/services/uom.service' // Types import type { Uom } from '~/models/uom' export const { recId, recAction, recItem, isReadonly, isProcessing, isFormEntryDialogOpen, isRecordConfirmationOpen, onResetState, handleActionSave, handleActionEdit, handleActionRemove, handleCancelForm, } = genCrudHandler({ create, update, remove, }) export async function getValueLabelList(params: any = null): Promise<{ value: string; label: string }[]> { let data: { value: string; label: string }[] = [] const result = await getList(params) if (result.success) { const resultData = result.body?.data || [] data = resultData.map((item: Uom) => ({ value: item.code || item.erp_id, label: item.name, })) } return data }