Get Unit Converter

This commit is contained in:
efrilm
2025-09-12 18:57:23 +07:00
parent 54c7598e7a
commit 76ee71e7fe
3 changed files with 52 additions and 0 deletions
+13
View File
@@ -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
}
})
}