chore: modify service and hanler
This commit is contained in:
No files matched your search
@@ -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')
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user