paxton-front/api/queries/useGetProductsVariationsList.ts
alsaze 7c811a4841
All checks were successful
Deploy / build (push) Successful in 46s
product-card чтобы запросы с undefined не сыпались
2025-09-26 02:07:26 +03:00

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),
})
}