feat/mcu: improved wip

This commit is contained in:
2025-11-23 15:56:31 +07:00
parent a40eac35f8
commit cf5789549e
6 changed files with 90 additions and 13 deletions
+13
View File
@@ -22,3 +22,16 @@ export function update(id: number | string, data: any) {
export function remove(id: number | string) {
return base.remove(path, id)
}
export async function submit(id: number) {
try {
const resp = await xfetch(`${path}/${id}/submit`, 'PATCH')
const result: any = {}
result.success = resp.success
result.body = (resp.body as Record<string, any>) || {}
return result
} catch (error) {
console.error(`Error submitting ${name}:`, error)
throw new Error(`Failed to submit ${name}`)
}
}