feat(sep): implement diagnose on sep form
This commit is contained in:
No files matched your search
@@ -5,5 +5,24 @@ const path = '/api/vclaim/diagnosa'
|
||||
const name = 'diagnose'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
return base.getList(path, params, name)
|
||||
let url = path
|
||||
if (params && params?.diagnosa) {
|
||||
url += `/${params.diagnosa}`
|
||||
delete params.diagnosa
|
||||
}
|
||||
return base.getList(url, params, name)
|
||||
}
|
||||
|
||||
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?.response?.diagnosa || []
|
||||
const resultUnique = [...new Map(resultData.map((item: any) => [item.kode, item])).values()]
|
||||
data = resultUnique.map((item: any) => ({
|
||||
value: item.kode ? String(item.kode) : '',
|
||||
label: item.nama,
|
||||
}))
|
||||
}
|
||||
return data
|
||||
}
|
||||
Reference in New Issue
Block a user