diff --git a/.changeset/afraid-socks-refuse.md b/.changeset/afraid-socks-refuse.md new file mode 100644 index 0000000000..b0ef08dedb --- /dev/null +++ b/.changeset/afraid-socks-refuse.md @@ -0,0 +1,5 @@ +--- +"@medusajs/dashboard": patch +--- + +fix(dashboard): product create discountable flag diff --git a/packages/admin/dashboard/src/components/common/switch-box/switch-box.tsx b/packages/admin/dashboard/src/components/common/switch-box/switch-box.tsx index 856753c599..913b8c16d2 100644 --- a/packages/admin/dashboard/src/components/common/switch-box/switch-box.tsx +++ b/packages/admin/dashboard/src/components/common/switch-box/switch-box.tsx @@ -6,13 +6,13 @@ import { Form } from "../../common/form" interface HeadlessControllerProps< TFieldValues extends FieldValues = FieldValues, - TName extends FieldPath = FieldPath -> extends Omit, "render"> {} + TName extends FieldPath = FieldPath, +> extends Omit, "render"> {} interface SwitchBoxProps< TFieldValues extends FieldValues = FieldValues, - TName extends FieldPath = FieldPath -> extends HeadlessControllerProps{ + TName extends FieldPath = FieldPath, +> extends HeadlessControllerProps { label: string description: string optional?: boolean @@ -26,13 +26,13 @@ interface SwitchBoxProps< /** * Wrapper for the Switch component to be used with `react-hook-form`. - * + * * Use this component whenever a design calls for wrapping the Switch component * in a container with a label and description. */ export const SwitchBox = < TFieldValues extends FieldValues = FieldValues, - TName extends FieldPath = FieldPath + TName extends FieldPath = FieldPath, >({ label, description, @@ -49,10 +49,14 @@ export const SwitchBox = <
- { - onCheckedChange?.(e) - onChange(e) - }} /> + { + onCheckedChange?.(e) + onChange(e) + }} + />
@@ -67,4 +71,4 @@ export const SwitchBox = < }} /> ) -} \ No newline at end of file +} diff --git a/packages/admin/dashboard/src/routes/products/product-create/utils.ts b/packages/admin/dashboard/src/routes/products/product-create/utils.ts index 848e7c67b3..31c74fd954 100644 --- a/packages/admin/dashboard/src/routes/products/product-create/utils.ts +++ b/packages/admin/dashboard/src/routes/products/product-create/utils.ts @@ -36,7 +36,7 @@ export const normalizeProductFormValues = ( title: values.title.trim(), subtitle: values.subtitle?.trim(), description: values.description?.trim(), - discountable: values.discountable || undefined, + discountable: values.discountable, width: values.width ? parseFloat(values.width) : undefined, length: values.length ? parseFloat(values.length) : undefined, height: values.height ? parseFloat(values.height) : undefined,