fix(dashboard): Prevent product metadata form from throwing error (#10312)

Resolves CMRC-755
This commit is contained in:
Kasper Fabricius Kristensen
2024-11-27 14:20:12 +01:00
committed by GitHub
parent 1b55f477a6
commit 2edc2fe19b
2 changed files with 7 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/dashboard": patch
---
fix(dashboard): Prevent product metadata form from throwing an error

View File

@@ -7,7 +7,7 @@ export const ProductMetadata = () => {
const { product, isPending, isError, error } = useProduct(id!)
const { mutateAsync, isPending: isMutating } = useUpdateProduct(product.id!)
const { mutateAsync, isPending: isMutating } = useUpdateProduct(product?.id!)
if (isError) {
throw error
@@ -15,7 +15,7 @@ export const ProductMetadata = () => {
return (
<MetadataForm
metadata={product.metadata}
metadata={product?.metadata}
hook={mutateAsync}
isPending={isPending}
isMutating={isMutating}