12 lines
398 B
TypeScript
12 lines
398 B
TypeScript
import { useQuery } from '@tanstack/vue-query'
|
|
import { unref } from 'vue'
|
|
import { getProductsVariationsList } from '~/api/endpoints'
|
|
|
|
export const useGetProductsVariationsList = (productId: MaybeRef<number>) => {
|
|
return useQuery({
|
|
queryKey: ['get-products-variations-list', productId],
|
|
queryFn: () => getProductsVariationsList(unref(productId)),
|
|
enabled: !!unref(productId),
|
|
})
|
|
}
|