feat(sep): implement dpjp
This commit is contained in:
@@ -1,9 +1,23 @@
|
||||
// Base
|
||||
import * as base from './_crud-base'
|
||||
|
||||
const path = '/api/vclaim/dokter-dpjp'
|
||||
const name = 'doctor-attending'
|
||||
const path = '/api/vclaim/referensi/dokter-dpjp'
|
||||
const name = 'doctor-dpjp'
|
||||
|
||||
export function getList(params: any = null) {
|
||||
return base.getList(path, 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?.list || []
|
||||
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