From 2edc2fe19b6afae41e3b6945b7abfbd8e3fa6e5c Mon Sep 17 00:00:00 2001 From: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com> Date: Wed, 27 Nov 2024 14:20:12 +0100 Subject: [PATCH] fix(dashboard): Prevent product metadata form from throwing error (#10312) Resolves CMRC-755 --- .changeset/chilly-walls-hope.md | 5 +++++ .../routes/products/product-metadata/product-metadata.tsx | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/chilly-walls-hope.md diff --git a/.changeset/chilly-walls-hope.md b/.changeset/chilly-walls-hope.md new file mode 100644 index 0000000000..f7d378227d --- /dev/null +++ b/.changeset/chilly-walls-hope.md @@ -0,0 +1,5 @@ +--- +"@medusajs/dashboard": patch +--- + +fix(dashboard): Prevent product metadata form from throwing an error diff --git a/packages/admin/dashboard/src/routes/products/product-metadata/product-metadata.tsx b/packages/admin/dashboard/src/routes/products/product-metadata/product-metadata.tsx index cd15d44ecd..553b2eb17f 100644 --- a/packages/admin/dashboard/src/routes/products/product-metadata/product-metadata.tsx +++ b/packages/admin/dashboard/src/routes/products/product-metadata/product-metadata.tsx @@ -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 (