docs: change useRemoteQueryStep to useQueryGraphStep (#10051)

* docs: change useRemoteQueryStep to useQueryGraphStep

* fix lint errors
This commit is contained in:
Shahed Nasser
2024-11-13 11:00:55 +02:00
committed by GitHub
parent 823552ecd9
commit 868b1c190f
17 changed files with 241 additions and 266 deletions
@@ -55,7 +55,7 @@ import { DetailWidgetProps, HttpTypes } from "@medusajs/framework/types"
const ProductWidget = () => {
const { data, isLoading } = useQuery({
queryFn: () => sdk.admin.product.list(),
queryKey: ["products"]
queryKey: ["products"],
})
return (
@@ -95,17 +95,17 @@ import { sdk } from "../lib/config"
import { DetailWidgetProps, HttpTypes } from "@medusajs/framework/types"
const ProductWidget = ({
data: productData
data: productData,
}: DetailWidgetProps<HttpTypes.AdminProduct>) => {
const { mutateAsync } = useMutation({
mutationFn: (payload: HttpTypes.AdminUpdateProduct) =>
sdk.admin.product.update(productData.id, payload),
onSuccess: () => alert("updated product")
onSuccess: () => alert("updated product"),
})
const handleUpdate = () => {
mutateAsync({
title: "New Product Title"
title: "New Product Title",
})
}