feat(sep): add form traffic accident

This commit is contained in:
riefive
2025-10-22 14:27:43 +07:00
parent baad005522
commit 00302ece84
7 changed files with 307 additions and 29 deletions

No files matched your search

@@ -12,3 +12,16 @@ export function getList(params: any = null) {
}
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?.list || []
data = resultData.map((item: any) => ({
value: item.kode ? String(item.kode) : '',
label: item.nama,
}))
}
return data
}
@@ -12,3 +12,16 @@ export function getList(params: any = null) {
}
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?.list || []
data = resultData.map((item: any) => ({
value: item.kode ? String(item.kode) : '',
label: item.nama,
}))
}
return data
}
@@ -7,3 +7,16 @@ const name = 'provinces'
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 || []
data = resultData.map((item: any) => ({
value: item.kode ? String(item.kode) : '',
label: item.nama,
}))
}
return data
}