paxton-front/api/queries/wp/useGetProductsDetail.ts
alsaze 7a7d27c7ae
All checks were successful
Deploy / build (push) Successful in 45s
создаю телегу товаров
2025-10-03 19:26:39 +03:00

12 lines
368 B
TypeScript

import { useQuery } from '@tanstack/vue-query'
import { unref } from 'vue'
import { getProductsDetail } from '~/api/endpoints/wp'
export const useGetProductsDetail = (productId: MaybeRef<number>) => {
return useQuery({
queryKey: ['get-products-detail', productId],
queryFn: () => getProductsDetail(unref(productId)),
enabled: !!unref(productId),
})
}