feat(material): create service get for material and uom

This commit is contained in:
riefive
2025-09-18 13:42:35 +07:00
parent 117e72fdce
commit 29b54b072c
4 changed files with 29 additions and 18 deletions
+9
View File
@@ -0,0 +1,9 @@
import { xfetch } from '~/composables/useXfetch'
export async function getSourceMaterials() {
const resp = await xfetch('/api/v1/material')
if (resp.success) {
return (resp.body as Record<string, any>).data
}
throw new Error('Failed to fetch source materials')
}
+9
View File
@@ -0,0 +1,9 @@
import { xfetch } from '~/composables/useXfetch'
export async function getSourceUoms() {
const resp = await xfetch('/api/v1/uom')
if (resp.success) {
return (resp.body as Record<string, any>).data
}
throw new Error('Failed to fetch source uoms')
}