Skip to content

Commit

Permalink
fix(dashboard): Prevent product metadata form from throwing error (#1…
Browse files Browse the repository at this point in the history
…0312)

Resolves CMRC-755
  • Loading branch information
kasperkristensen authored Nov 27, 2024
1 parent 1b55f47 commit 2edc2fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-walls-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/dashboard": patch
---

fix(dashboard): Prevent product metadata form from throwing an error
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ 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
}

return (
<MetadataForm
metadata={product.metadata}
metadata={product?.metadata}
hook={mutateAsync}
isPending={isPending}
isMutating={isMutating}
Expand Down

0 comments on commit 2edc2fe

Please sign in to comment.