fix(dashboard): Prevent product metadata form from throwing error (#10312)
Resolves CMRC-755
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/dashboard": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(dashboard): Prevent product metadata form from throwing an error
|
||||||
@@ -7,7 +7,7 @@ export const ProductMetadata = () => {
|
|||||||
|
|
||||||
const { product, isPending, isError, error } = useProduct(id!)
|
const { product, isPending, isError, error } = useProduct(id!)
|
||||||
|
|
||||||
const { mutateAsync, isPending: isMutating } = useUpdateProduct(product.id!)
|
const { mutateAsync, isPending: isMutating } = useUpdateProduct(product?.id!)
|
||||||
|
|
||||||
if (isError) {
|
if (isError) {
|
||||||
throw error
|
throw error
|
||||||
@@ -15,7 +15,7 @@ export const ProductMetadata = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<MetadataForm
|
<MetadataForm
|
||||||
metadata={product.metadata}
|
metadata={product?.metadata}
|
||||||
hook={mutateAsync}
|
hook={mutateAsync}
|
||||||
isPending={isPending}
|
isPending={isPending}
|
||||||
isMutating={isMutating}
|
isMutating={isMutating}
|
||||||
|
|||||||
Reference in New Issue
Block a user