diff --git a/.changeset/empty-rockets-sink.md b/.changeset/empty-rockets-sink.md new file mode 100644 index 0000000000..812235502d --- /dev/null +++ b/.changeset/empty-rockets-sink.md @@ -0,0 +1,5 @@ +--- +"@medusajs/dashboard": patch +--- + +feat(dashboard): Add first and last name inputs to update order shipping and billing address forms diff --git a/packages/admin/dashboard/src/routes/orders/order-edit-billing-address/components/edit-order-billing-address-form/edit-order-billing-address-form.tsx b/packages/admin/dashboard/src/routes/orders/order-edit-billing-address/components/edit-order-billing-address-form/edit-order-billing-address-form.tsx index b20e97b395..d095c3e207 100644 --- a/packages/admin/dashboard/src/routes/orders/order-edit-billing-address/components/edit-order-billing-address-form/edit-order-billing-address-form.tsx +++ b/packages/admin/dashboard/src/routes/orders/order-edit-billing-address/components/edit-order-billing-address-form/edit-order-billing-address-form.tsx @@ -16,6 +16,8 @@ type EditOrderBillingAddressFormProps = { } const EditOrderBillingAddressSchema = zod.object({ + first_name: zod.string().optional(), + last_name: zod.string().optional(), address_1: zod.string().min(1), address_2: zod.string().optional(), country_code: zod.string().min(2).max(2), @@ -34,6 +36,8 @@ export function EditOrderBillingAddressForm({ const form = useForm>({ defaultValues: { + first_name: order.billing_address?.first_name || "", + last_name: order.billing_address?.last_name || "", address_1: order.billing_address?.address_1 || "", address_2: order.billing_address?.address_2 || "", city: order.billing_address?.city || "", @@ -158,6 +162,36 @@ export function EditOrderBillingAddressForm({ ) }} /> + { + return ( + + {t("fields.firstName")} + + + + + + ) + }} + /> + { + return ( + + {t("fields.lastName")} + + + + + + ) + }} + /> >({ defaultValues: { + first_name: order.shipping_address?.first_name || "", + last_name: order.shipping_address?.last_name || "", address_1: order.shipping_address?.address_1 || "", address_2: order.shipping_address?.address_2 || "", city: order.shipping_address?.city || "", @@ -158,6 +162,34 @@ export function EditOrderShippingAddressForm({ ) }} /> + { + return ( + + {t("fields.firstName")} + + + + + ) + }} + /> + { + return ( + + {t("fields.lastName")} + + + + + ) + }} + />