docs: update to next 15 + eslint 9 (#9839)
* update next * updated react * update eslint * finish updating eslint * fix content lint errors * fix docs test * fix vale action * fix installation errors
This commit is contained in:
@@ -296,7 +296,7 @@ import { DetailWidgetProps, HttpTypes } from "@medusajs/framework/types"
|
||||
const ProductWidget = () => {
|
||||
const { data, isLoading } = useQuery({
|
||||
queryFn: () => sdk.admin.product.list(),
|
||||
queryKey: ["products"]
|
||||
queryKey: ["products"],
|
||||
})
|
||||
|
||||
return (
|
||||
@@ -331,17 +331,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",
|
||||
})
|
||||
}
|
||||
|
||||
@@ -375,8 +375,8 @@ For example:
|
||||
```ts highlights={[["2", "next"], ["3", "tags", "An array of tags to cache the data under."]]}
|
||||
sdk.store.product.list({}, {
|
||||
next: {
|
||||
tags: ["products"]
|
||||
}
|
||||
tags: ["products"],
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
@@ -385,7 +385,7 @@ The `tags` property accepts an array of tags that the data is cached under.
|
||||
Then, to purge the cache later, use Next.js's `revalidateTag` utility:
|
||||
|
||||
```ts
|
||||
import { revalidateTag } from "next/cache";
|
||||
import { revalidateTag } from "next/cache"
|
||||
|
||||
// ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user