Get Unit Converter
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { UnitConversion } from '@/types/services/productRecipe'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { api } from '../api'
|
||||
|
||||
export function useUnitConverterByIngredient(IngredientId: string) {
|
||||
return useQuery<UnitConversion[]>({
|
||||
queryKey: ['unit-converters/ingredient', IngredientId],
|
||||
queryFn: async () => {
|
||||
const res = await api.get(`/unit-converters/ingredient/${IngredientId}`)
|
||||
return res.data.data
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user