feat(sep): integrate visit sep

This commit is contained in:
riefive
2025-10-20 14:14:17 +07:00
parent 499548c770
commit 9647cfa3ff
6 changed files with 154 additions and 10 deletions
@@ -0,0 +1,23 @@
// Base
import * as base from './_crud-base'
const path = '/api/vclaim/referensi/faskes'
const name = 'faskes'
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?.faskes || []
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
}