Страница по uid
Some checks failed
Deploy / build-and-deploy (push) Failing after 29s

This commit is contained in:
Veselov
2025-07-28 17:49:59 +03:00
parent c5603e6789
commit cd32863494
3 changed files with 86 additions and 17 deletions

View File

@@ -1,14 +1,10 @@
import { useQuery } from '@tanstack/vue-query'
import { unref, watch } from 'vue'
import { unref } from 'vue'
import { getProductsDetail } from '~/api/endpoints'
export const useGetProductsDetail = (productId: MaybeRef<number>) => {
const q = useQuery({
queryKey: ['get-products-detail', unref(productId)],
return useQuery({
queryKey: ['get-products-detail', productId],
queryFn: () => getProductsDetail(unref(productId)),
})
watch(() => productId, () => q.refetch())
return q
}