fix: update some service

This commit is contained in:
riefive
2025-10-06 10:38:10 +07:00
parent 78ae8a8aa0
commit d1bcd6e66c
11 changed files with 117 additions and 163 deletions

No files matched your search

+17
View File
@@ -1,5 +1,9 @@
// Base
import * as base from './_crud-base'
// Types
import type { Installation } from '~/models/installation'
const path = '/api/v1/installation'
const name = 'installation'
@@ -22,3 +26,16 @@ export function update(id: number | string, data: any) {
export function remove(id: number | string) {
return base.remove(path, id, 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?.data || []
data = resultData.map((item: Installation) => ({
value: item.id ? Number(item.id) : item.code,
label: item.name,
}))
}
return data
}