feat(material): create service get for material and uom
This commit is contained in:
@@ -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')
|
||||
}
|
||||
@@ -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')
|
||||
}
|
||||
Reference in New Issue
Block a user