chore: modify service and hanler

This commit is contained in:
riefive
2025-09-26 14:03:44 +07:00
parent 34a4fc11d0
commit 5d41e4e60d
9 changed files with 116 additions and 62 deletions

No files matched your search

+9 -9
View File
@@ -29,8 +29,8 @@ export async function getMedicineMethods(params: any = null) {
result.body = (resp.body as Record<string, any>) || {}
return result
} catch (error) {
console.error('Error fetching source materials:', error)
throw new Error('Failed to fetch source materials')
console.error('Error fetching medicine methods:', error)
throw new Error('Failed to fetch medicine methods')
}
}
@@ -42,8 +42,8 @@ export async function getMedicineMethodDetail(id: number | string) {
result.body = (resp.body as Record<string, any>) || {}
return result
} catch (error) {
console.error('Error fetching source material detail:', error)
throw new Error('Failed to get source material detail')
console.error('Error fetching medicine method detail:', error)
throw new Error('Failed to get medicine method detail')
}
}
@@ -55,8 +55,8 @@ export async function postMedicineMethod(record: any) {
result.body = (resp.body as Record<string, any>) || {}
return result
} catch (error) {
console.error('Error posting source material:', error)
throw new Error('Failed to post source material')
console.error('Error posting medicine method:', error)
throw new Error('Failed to post medicine method')
}
}
@@ -68,8 +68,8 @@ export async function patchMedicineMethod(id: number | string, record: any) {
result.body = (resp.body as Record<string, any>) || {}
return result
} catch (error) {
console.error('Error putting source material:', error)
throw new Error('Failed to put source material')
console.error('Error putting medicine method:', error)
throw new Error('Failed to put medicine method')
}
}
@@ -82,6 +82,6 @@ export async function removeMedicineMethod(id: number | string) {
return result
} catch (error) {
console.error('Error deleting record:', error)
throw new Error('Failed to delete source material')
throw new Error('Failed to delete medicine method')
}
}