This commit is contained in:
2024-04-12 07:35:41 +03:00
parent 9815ebbc3b
commit 2d1fdf1ad9
41 changed files with 1199 additions and 85 deletions

View File

@@ -0,0 +1,11 @@
import {ProductService} from "../../client";
import {useQuery} from "@tanstack/react-query";
export const useGetProductById = (id: number) => {
const {data, error, isLoading, refetch} = useQuery({
queryKey: ['getProductById', id],
queryFn: () => ProductService.getProductById({productId: id}),
select: (data) => data
});
return {product: data, error, isLoading, refetch}
}