@medusajs/draft-order 2.11.2-preview-20251029180202 → 2.11.2-preview-20251029210154

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9776,6 +9776,74 @@ const CustomItemsForm = () => {
9776
9776
  const schema$4 = objectType({
9777
9777
  email: stringType().email()
9778
9778
  });
9779
+ const Email = () => {
9780
+ const { id } = useParams();
9781
+ const { order, isPending, isError, error } = useOrder(id, {
9782
+ fields: "+email"
9783
+ });
9784
+ if (isError) {
9785
+ throw error;
9786
+ }
9787
+ const isReady = !isPending && !!order;
9788
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
9789
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
9790
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Email" }) }),
9791
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
9792
+ ] }),
9793
+ isReady && /* @__PURE__ */ jsx(EmailForm, { order })
9794
+ ] });
9795
+ };
9796
+ const EmailForm = ({ order }) => {
9797
+ const form = useForm({
9798
+ defaultValues: {
9799
+ email: order.email ?? ""
9800
+ },
9801
+ resolver: zodResolver(schema$3)
9802
+ });
9803
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9804
+ const { handleSuccess } = useRouteModal();
9805
+ const onSubmit = form.handleSubmit(async (data) => {
9806
+ await mutateAsync(
9807
+ { email: data.email },
9808
+ {
9809
+ onSuccess: () => {
9810
+ handleSuccess();
9811
+ },
9812
+ onError: (error) => {
9813
+ toast.error(error.message);
9814
+ }
9815
+ }
9816
+ );
9817
+ });
9818
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
9819
+ KeyboundForm,
9820
+ {
9821
+ className: "flex flex-1 flex-col overflow-hidden",
9822
+ onSubmit,
9823
+ children: [
9824
+ /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
9825
+ Form$2.Field,
9826
+ {
9827
+ control: form.control,
9828
+ name: "email",
9829
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9830
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Email" }),
9831
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9832
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9833
+ ] })
9834
+ }
9835
+ ) }),
9836
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
9837
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9838
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9839
+ ] }) })
9840
+ ]
9841
+ }
9842
+ ) });
9843
+ };
9844
+ const schema$3 = objectType({
9845
+ email: stringType().email()
9846
+ });
9779
9847
  const NumberInput = forwardRef(
9780
9848
  ({
9781
9849
  value,
@@ -11405,7 +11473,7 @@ const SalesChannelForm = ({ order }) => {
11405
11473
  defaultValues: {
11406
11474
  sales_channel_id: order.sales_channel_id || ""
11407
11475
  },
11408
- resolver: zodResolver(schema$3)
11476
+ resolver: zodResolver(schema$2)
11409
11477
  });
11410
11478
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11411
11479
  const { handleSuccess } = useRouteModal();
@@ -11480,334 +11548,131 @@ const SalesChannelField = ({ control, order }) => {
11480
11548
  }
11481
11549
  );
11482
11550
  };
11483
- const schema$3 = objectType({
11551
+ const schema$2 = objectType({
11484
11552
  sales_channel_id: stringType().min(1)
11485
11553
  });
11486
- const ShippingAddress = () => {
11554
+ const STACKED_FOCUS_MODAL_ID = "shipping-form";
11555
+ const Shipping = () => {
11556
+ var _a;
11487
11557
  const { id } = useParams();
11488
11558
  const { order, isPending, isError, error } = useOrder(id, {
11489
- fields: "+shipping_address"
11559
+ fields: "+items.*,+items.variant.*,+items.variant.product.*,+items.variant.product.shipping_profile.*,+currency_code"
11490
11560
  });
11561
+ const {
11562
+ order: preview,
11563
+ isPending: isPreviewPending,
11564
+ isError: isPreviewError,
11565
+ error: previewError
11566
+ } = useOrderPreview(id);
11567
+ useInitiateOrderEdit({ preview });
11568
+ const { onCancel } = useCancelOrderEdit({ preview });
11491
11569
  if (isError) {
11492
11570
  throw error;
11493
11571
  }
11494
- const isReady = !isPending && !!order;
11495
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
11496
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
11497
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Shipping Address" }) }),
11498
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
11499
- ] }),
11500
- isReady && /* @__PURE__ */ jsx(ShippingAddressForm, { order })
11501
- ] });
11572
+ if (isPreviewError) {
11573
+ throw previewError;
11574
+ }
11575
+ const orderHasItems = (((_a = order == null ? void 0 : order.items) == null ? void 0 : _a.length) || 0) > 0;
11576
+ const isReady = preview && !isPreviewPending && order && !isPending;
11577
+ return /* @__PURE__ */ jsx(RouteFocusModal, { onClose: onCancel, children: !orderHasItems ? /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col overflow-hidden ", children: [
11578
+ /* @__PURE__ */ jsx(RouteFocusModal.Header, {}),
11579
+ /* @__PURE__ */ jsx(RouteFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 py-16 px-6", children: [
11580
+ /* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Shipping" }) }),
11581
+ /* @__PURE__ */ jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "This draft order currently has no items. Add items to the order before adding shipping." }) })
11582
+ ] }) }) }),
11583
+ /* @__PURE__ */ jsx(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", type: "button", children: "Cancel" }) }) })
11584
+ ] }) : isReady ? /* @__PURE__ */ jsx(ShippingForm, { preview, order }) : /* @__PURE__ */ jsxs("div", { children: [
11585
+ /* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit Shipping" }) }),
11586
+ /* @__PURE__ */ jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Loading data for the draft order, please wait..." }) })
11587
+ ] }) });
11502
11588
  };
11503
- const ShippingAddressForm = ({ order }) => {
11504
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
11505
- const form = useForm({
11506
- defaultValues: {
11507
- first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
11508
- last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
11509
- company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
11510
- address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
11511
- address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
11512
- city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
11513
- province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
11514
- country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
11515
- postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
11516
- phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
11589
+ const ShippingForm = ({ preview, order }) => {
11590
+ var _a;
11591
+ const { setIsOpen } = useStackedModal();
11592
+ const [isSubmitting, setIsSubmitting] = useState(false);
11593
+ const [data, setData] = useState(null);
11594
+ const appliedShippingOptionIds = (_a = preview.shipping_methods) == null ? void 0 : _a.map((method) => method.shipping_option_id).filter(Boolean);
11595
+ const { shipping_options } = useShippingOptions(
11596
+ {
11597
+ id: appliedShippingOptionIds,
11598
+ fields: "+service_zone.*,+service_zone.fulfillment_set.*,+service_zone.fulfillment_set.location.*"
11517
11599
  },
11518
- resolver: zodResolver(schema$2)
11519
- });
11520
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11600
+ {
11601
+ enabled: appliedShippingOptionIds.length > 0
11602
+ }
11603
+ );
11604
+ const uniqueShippingProfiles = useMemo(() => {
11605
+ const profiles = /* @__PURE__ */ new Map();
11606
+ getUniqueShippingProfiles(order.items).forEach((profile) => {
11607
+ profiles.set(profile.id, profile);
11608
+ });
11609
+ shipping_options == null ? void 0 : shipping_options.forEach((option) => {
11610
+ profiles.set(option.shipping_profile_id, option.shipping_profile);
11611
+ });
11612
+ return Array.from(profiles.values());
11613
+ }, [order.items, shipping_options]);
11521
11614
  const { handleSuccess } = useRouteModal();
11522
- const onSubmit = form.handleSubmit(async (data) => {
11523
- await mutateAsync(
11524
- {
11525
- shipping_address: {
11526
- first_name: data.first_name,
11527
- last_name: data.last_name,
11528
- company: data.company,
11529
- address_1: data.address_1,
11530
- address_2: data.address_2,
11531
- city: data.city,
11532
- province: data.province,
11533
- country_code: data.country_code,
11534
- postal_code: data.postal_code,
11535
- phone: data.phone
11536
- }
11615
+ const { mutateAsync: confirmOrderEdit } = useDraftOrderConfirmEdit(preview.id);
11616
+ const { mutateAsync: requestOrderEdit } = useDraftOrderRequestEdit(preview.id);
11617
+ const { mutateAsync: removeShippingMethod } = useDraftOrderRemoveShippingMethod(preview.id);
11618
+ const { mutateAsync: removeActionShippingMethod } = useDraftOrderRemoveActionShippingMethod(preview.id);
11619
+ const onSubmit = async () => {
11620
+ setIsSubmitting(true);
11621
+ let requestSucceeded = false;
11622
+ await requestOrderEdit(void 0, {
11623
+ onError: (e) => {
11624
+ toast.error(`Failed to request order edit: ${e.message}`);
11537
11625
  },
11538
- {
11539
- onSuccess: () => {
11540
- handleSuccess();
11541
- },
11542
- onError: (error) => {
11543
- toast.error(error.message);
11626
+ onSuccess: () => {
11627
+ requestSucceeded = true;
11628
+ }
11629
+ });
11630
+ if (!requestSucceeded) {
11631
+ setIsSubmitting(false);
11632
+ return;
11633
+ }
11634
+ await confirmOrderEdit(void 0, {
11635
+ onError: (e) => {
11636
+ toast.error(`Failed to confirm order edit: ${e.message}`);
11637
+ },
11638
+ onSuccess: () => {
11639
+ handleSuccess();
11640
+ },
11641
+ onSettled: () => {
11642
+ setIsSubmitting(false);
11643
+ }
11644
+ });
11645
+ };
11646
+ const onKeydown = useCallback(
11647
+ (e) => {
11648
+ if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
11649
+ if (data || isSubmitting) {
11650
+ return;
11544
11651
  }
11652
+ onSubmit();
11545
11653
  }
11546
- );
11547
- });
11548
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
11549
- KeyboundForm,
11550
- {
11551
- className: "flex flex-1 flex-col overflow-hidden",
11552
- onSubmit,
11553
- children: [
11554
- /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
11555
- /* @__PURE__ */ jsx(
11556
- Form$2.Field,
11557
- {
11558
- control: form.control,
11559
- name: "country_code",
11560
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11561
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
11562
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
11563
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11564
- ] })
11565
- }
11566
- ),
11567
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11654
+ },
11655
+ [data, isSubmitting, onSubmit]
11656
+ );
11657
+ useEffect(() => {
11658
+ document.addEventListener("keydown", onKeydown);
11659
+ return () => {
11660
+ document.removeEventListener("keydown", onKeydown);
11661
+ };
11662
+ }, [onKeydown]);
11663
+ return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
11664
+ /* @__PURE__ */ jsx(RouteFocusModal.Header, {}),
11665
+ /* @__PURE__ */ jsxs(RouteFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: [
11666
+ /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 py-16 px-6", children: [
11667
+ /* @__PURE__ */ jsxs("div", { children: [
11668
+ /* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Shipping" }) }),
11669
+ /* @__PURE__ */ jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Choose which shipping method(s) to use for the items in the order." }) })
11670
+ ] }),
11671
+ /* @__PURE__ */ jsx(Divider, { variant: "dashed" }),
11672
+ /* @__PURE__ */ jsx(Accordion.Root, { type: "multiple", children: /* @__PURE__ */ jsxs("div", { className: "bg-ui-bg-subtle rounded-xl shadow-elevation-card-rest", children: [
11673
+ /* @__PURE__ */ jsxs("div", { className: "px-4 py-2 flex items-center justify-between", children: [
11568
11674
  /* @__PURE__ */ jsx(
11569
- Form$2.Field,
11570
- {
11571
- control: form.control,
11572
- name: "first_name",
11573
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11574
- /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
11575
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11576
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11577
- ] })
11578
- }
11579
- ),
11580
- /* @__PURE__ */ jsx(
11581
- Form$2.Field,
11582
- {
11583
- control: form.control,
11584
- name: "last_name",
11585
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11586
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
11587
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11588
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11589
- ] })
11590
- }
11591
- )
11592
- ] }),
11593
- /* @__PURE__ */ jsx(
11594
- Form$2.Field,
11595
- {
11596
- control: form.control,
11597
- name: "company",
11598
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11599
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
11600
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11601
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11602
- ] })
11603
- }
11604
- ),
11605
- /* @__PURE__ */ jsx(
11606
- Form$2.Field,
11607
- {
11608
- control: form.control,
11609
- name: "address_1",
11610
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11611
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
11612
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11613
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11614
- ] })
11615
- }
11616
- ),
11617
- /* @__PURE__ */ jsx(
11618
- Form$2.Field,
11619
- {
11620
- control: form.control,
11621
- name: "address_2",
11622
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11623
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
11624
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11625
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11626
- ] })
11627
- }
11628
- ),
11629
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11630
- /* @__PURE__ */ jsx(
11631
- Form$2.Field,
11632
- {
11633
- control: form.control,
11634
- name: "postal_code",
11635
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11636
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
11637
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11638
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11639
- ] })
11640
- }
11641
- ),
11642
- /* @__PURE__ */ jsx(
11643
- Form$2.Field,
11644
- {
11645
- control: form.control,
11646
- name: "city",
11647
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11648
- /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
11649
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11650
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11651
- ] })
11652
- }
11653
- )
11654
- ] }),
11655
- /* @__PURE__ */ jsx(
11656
- Form$2.Field,
11657
- {
11658
- control: form.control,
11659
- name: "province",
11660
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11661
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
11662
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11663
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11664
- ] })
11665
- }
11666
- ),
11667
- /* @__PURE__ */ jsx(
11668
- Form$2.Field,
11669
- {
11670
- control: form.control,
11671
- name: "phone",
11672
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11673
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
11674
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11675
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11676
- ] })
11677
- }
11678
- )
11679
- ] }) }),
11680
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
11681
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
11682
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
11683
- ] }) })
11684
- ]
11685
- }
11686
- ) });
11687
- };
11688
- const schema$2 = addressSchema;
11689
- const STACKED_FOCUS_MODAL_ID = "shipping-form";
11690
- const Shipping = () => {
11691
- var _a;
11692
- const { id } = useParams();
11693
- const { order, isPending, isError, error } = useOrder(id, {
11694
- fields: "+items.*,+items.variant.*,+items.variant.product.*,+items.variant.product.shipping_profile.*,+currency_code"
11695
- });
11696
- const {
11697
- order: preview,
11698
- isPending: isPreviewPending,
11699
- isError: isPreviewError,
11700
- error: previewError
11701
- } = useOrderPreview(id);
11702
- useInitiateOrderEdit({ preview });
11703
- const { onCancel } = useCancelOrderEdit({ preview });
11704
- if (isError) {
11705
- throw error;
11706
- }
11707
- if (isPreviewError) {
11708
- throw previewError;
11709
- }
11710
- const orderHasItems = (((_a = order == null ? void 0 : order.items) == null ? void 0 : _a.length) || 0) > 0;
11711
- const isReady = preview && !isPreviewPending && order && !isPending;
11712
- return /* @__PURE__ */ jsx(RouteFocusModal, { onClose: onCancel, children: !orderHasItems ? /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col overflow-hidden ", children: [
11713
- /* @__PURE__ */ jsx(RouteFocusModal.Header, {}),
11714
- /* @__PURE__ */ jsx(RouteFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 py-16 px-6", children: [
11715
- /* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Shipping" }) }),
11716
- /* @__PURE__ */ jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "This draft order currently has no items. Add items to the order before adding shipping." }) })
11717
- ] }) }) }),
11718
- /* @__PURE__ */ jsx(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", type: "button", children: "Cancel" }) }) })
11719
- ] }) : isReady ? /* @__PURE__ */ jsx(ShippingForm, { preview, order }) : /* @__PURE__ */ jsxs("div", { children: [
11720
- /* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit Shipping" }) }),
11721
- /* @__PURE__ */ jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Loading data for the draft order, please wait..." }) })
11722
- ] }) });
11723
- };
11724
- const ShippingForm = ({ preview, order }) => {
11725
- var _a;
11726
- const { setIsOpen } = useStackedModal();
11727
- const [isSubmitting, setIsSubmitting] = useState(false);
11728
- const [data, setData] = useState(null);
11729
- const appliedShippingOptionIds = (_a = preview.shipping_methods) == null ? void 0 : _a.map((method) => method.shipping_option_id).filter(Boolean);
11730
- const { shipping_options } = useShippingOptions(
11731
- {
11732
- id: appliedShippingOptionIds,
11733
- fields: "+service_zone.*,+service_zone.fulfillment_set.*,+service_zone.fulfillment_set.location.*"
11734
- },
11735
- {
11736
- enabled: appliedShippingOptionIds.length > 0
11737
- }
11738
- );
11739
- const uniqueShippingProfiles = useMemo(() => {
11740
- const profiles = /* @__PURE__ */ new Map();
11741
- getUniqueShippingProfiles(order.items).forEach((profile) => {
11742
- profiles.set(profile.id, profile);
11743
- });
11744
- shipping_options == null ? void 0 : shipping_options.forEach((option) => {
11745
- profiles.set(option.shipping_profile_id, option.shipping_profile);
11746
- });
11747
- return Array.from(profiles.values());
11748
- }, [order.items, shipping_options]);
11749
- const { handleSuccess } = useRouteModal();
11750
- const { mutateAsync: confirmOrderEdit } = useDraftOrderConfirmEdit(preview.id);
11751
- const { mutateAsync: requestOrderEdit } = useDraftOrderRequestEdit(preview.id);
11752
- const { mutateAsync: removeShippingMethod } = useDraftOrderRemoveShippingMethod(preview.id);
11753
- const { mutateAsync: removeActionShippingMethod } = useDraftOrderRemoveActionShippingMethod(preview.id);
11754
- const onSubmit = async () => {
11755
- setIsSubmitting(true);
11756
- let requestSucceeded = false;
11757
- await requestOrderEdit(void 0, {
11758
- onError: (e) => {
11759
- toast.error(`Failed to request order edit: ${e.message}`);
11760
- },
11761
- onSuccess: () => {
11762
- requestSucceeded = true;
11763
- }
11764
- });
11765
- if (!requestSucceeded) {
11766
- setIsSubmitting(false);
11767
- return;
11768
- }
11769
- await confirmOrderEdit(void 0, {
11770
- onError: (e) => {
11771
- toast.error(`Failed to confirm order edit: ${e.message}`);
11772
- },
11773
- onSuccess: () => {
11774
- handleSuccess();
11775
- },
11776
- onSettled: () => {
11777
- setIsSubmitting(false);
11778
- }
11779
- });
11780
- };
11781
- const onKeydown = useCallback(
11782
- (e) => {
11783
- if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
11784
- if (data || isSubmitting) {
11785
- return;
11786
- }
11787
- onSubmit();
11788
- }
11789
- },
11790
- [data, isSubmitting, onSubmit]
11791
- );
11792
- useEffect(() => {
11793
- document.addEventListener("keydown", onKeydown);
11794
- return () => {
11795
- document.removeEventListener("keydown", onKeydown);
11796
- };
11797
- }, [onKeydown]);
11798
- return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
11799
- /* @__PURE__ */ jsx(RouteFocusModal.Header, {}),
11800
- /* @__PURE__ */ jsxs(RouteFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: [
11801
- /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 py-16 px-6", children: [
11802
- /* @__PURE__ */ jsxs("div", { children: [
11803
- /* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Shipping" }) }),
11804
- /* @__PURE__ */ jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Choose which shipping method(s) to use for the items in the order." }) })
11805
- ] }),
11806
- /* @__PURE__ */ jsx(Divider, { variant: "dashed" }),
11807
- /* @__PURE__ */ jsx(Accordion.Root, { type: "multiple", children: /* @__PURE__ */ jsxs("div", { className: "bg-ui-bg-subtle rounded-xl shadow-elevation-card-rest", children: [
11808
- /* @__PURE__ */ jsxs("div", { className: "px-4 py-2 flex items-center justify-between", children: [
11809
- /* @__PURE__ */ jsx(
11810
- Text,
11675
+ Text,
11811
11676
  {
11812
11677
  size: "xsmall",
11813
11678
  weight: "plus",
@@ -12493,30 +12358,233 @@ const CustomAmountField = ({
12493
12358
  }
12494
12359
  );
12495
12360
  };
12496
- const TransferOwnership = () => {
12361
+ const ShippingAddress = () => {
12497
12362
  const { id } = useParams();
12498
- const { draft_order, isPending, isError, error } = useDraftOrder(id, {
12499
- fields: "id,customer_id,customer.*"
12363
+ const { order, isPending, isError, error } = useOrder(id, {
12364
+ fields: "+shipping_address"
12500
12365
  });
12501
12366
  if (isError) {
12502
12367
  throw error;
12503
12368
  }
12504
- const isReady = !isPending && !!draft_order;
12369
+ const isReady = !isPending && !!order;
12505
12370
  return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
12506
12371
  /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
12507
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Transfer Ownership" }) }),
12508
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Transfer the ownership of this draft order to a new customer" }) })
12372
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Shipping Address" }) }),
12373
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
12509
12374
  ] }),
12510
- isReady && /* @__PURE__ */ jsx(TransferOwnershipForm, { order: draft_order })
12375
+ isReady && /* @__PURE__ */ jsx(ShippingAddressForm, { order })
12511
12376
  ] });
12512
12377
  };
12513
- const TransferOwnershipForm = ({ order }) => {
12514
- var _a, _b;
12378
+ const ShippingAddressForm = ({ order }) => {
12379
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12515
12380
  const form = useForm({
12516
12381
  defaultValues: {
12517
- customer_id: order.customer_id || ""
12518
- },
12519
- resolver: zodResolver(schema$1)
12382
+ first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
12383
+ last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
12384
+ company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
12385
+ address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
12386
+ address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
12387
+ city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
12388
+ province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
12389
+ country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
12390
+ postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12391
+ phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12392
+ },
12393
+ resolver: zodResolver(schema$1)
12394
+ });
12395
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12396
+ const { handleSuccess } = useRouteModal();
12397
+ const onSubmit = form.handleSubmit(async (data) => {
12398
+ await mutateAsync(
12399
+ {
12400
+ shipping_address: {
12401
+ first_name: data.first_name,
12402
+ last_name: data.last_name,
12403
+ company: data.company,
12404
+ address_1: data.address_1,
12405
+ address_2: data.address_2,
12406
+ city: data.city,
12407
+ province: data.province,
12408
+ country_code: data.country_code,
12409
+ postal_code: data.postal_code,
12410
+ phone: data.phone
12411
+ }
12412
+ },
12413
+ {
12414
+ onSuccess: () => {
12415
+ handleSuccess();
12416
+ },
12417
+ onError: (error) => {
12418
+ toast.error(error.message);
12419
+ }
12420
+ }
12421
+ );
12422
+ });
12423
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
12424
+ KeyboundForm,
12425
+ {
12426
+ className: "flex flex-1 flex-col overflow-hidden",
12427
+ onSubmit,
12428
+ children: [
12429
+ /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
12430
+ /* @__PURE__ */ jsx(
12431
+ Form$2.Field,
12432
+ {
12433
+ control: form.control,
12434
+ name: "country_code",
12435
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12436
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
12437
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
12438
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12439
+ ] })
12440
+ }
12441
+ ),
12442
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12443
+ /* @__PURE__ */ jsx(
12444
+ Form$2.Field,
12445
+ {
12446
+ control: form.control,
12447
+ name: "first_name",
12448
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12449
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
12450
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12451
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12452
+ ] })
12453
+ }
12454
+ ),
12455
+ /* @__PURE__ */ jsx(
12456
+ Form$2.Field,
12457
+ {
12458
+ control: form.control,
12459
+ name: "last_name",
12460
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12461
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
12462
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12463
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12464
+ ] })
12465
+ }
12466
+ )
12467
+ ] }),
12468
+ /* @__PURE__ */ jsx(
12469
+ Form$2.Field,
12470
+ {
12471
+ control: form.control,
12472
+ name: "company",
12473
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12474
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
12475
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12476
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12477
+ ] })
12478
+ }
12479
+ ),
12480
+ /* @__PURE__ */ jsx(
12481
+ Form$2.Field,
12482
+ {
12483
+ control: form.control,
12484
+ name: "address_1",
12485
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12486
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
12487
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12488
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12489
+ ] })
12490
+ }
12491
+ ),
12492
+ /* @__PURE__ */ jsx(
12493
+ Form$2.Field,
12494
+ {
12495
+ control: form.control,
12496
+ name: "address_2",
12497
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12498
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
12499
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12500
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12501
+ ] })
12502
+ }
12503
+ ),
12504
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12505
+ /* @__PURE__ */ jsx(
12506
+ Form$2.Field,
12507
+ {
12508
+ control: form.control,
12509
+ name: "postal_code",
12510
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12511
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
12512
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12513
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12514
+ ] })
12515
+ }
12516
+ ),
12517
+ /* @__PURE__ */ jsx(
12518
+ Form$2.Field,
12519
+ {
12520
+ control: form.control,
12521
+ name: "city",
12522
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12523
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
12524
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12525
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12526
+ ] })
12527
+ }
12528
+ )
12529
+ ] }),
12530
+ /* @__PURE__ */ jsx(
12531
+ Form$2.Field,
12532
+ {
12533
+ control: form.control,
12534
+ name: "province",
12535
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12536
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
12537
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12538
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12539
+ ] })
12540
+ }
12541
+ ),
12542
+ /* @__PURE__ */ jsx(
12543
+ Form$2.Field,
12544
+ {
12545
+ control: form.control,
12546
+ name: "phone",
12547
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12548
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
12549
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12550
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12551
+ ] })
12552
+ }
12553
+ )
12554
+ ] }) }),
12555
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
12556
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
12557
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
12558
+ ] }) })
12559
+ ]
12560
+ }
12561
+ ) });
12562
+ };
12563
+ const schema$1 = addressSchema;
12564
+ const TransferOwnership = () => {
12565
+ const { id } = useParams();
12566
+ const { draft_order, isPending, isError, error } = useDraftOrder(id, {
12567
+ fields: "id,customer_id,customer.*"
12568
+ });
12569
+ if (isError) {
12570
+ throw error;
12571
+ }
12572
+ const isReady = !isPending && !!draft_order;
12573
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
12574
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
12575
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Transfer Ownership" }) }),
12576
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Transfer the ownership of this draft order to a new customer" }) })
12577
+ ] }),
12578
+ isReady && /* @__PURE__ */ jsx(TransferOwnershipForm, { order: draft_order })
12579
+ ] });
12580
+ };
12581
+ const TransferOwnershipForm = ({ order }) => {
12582
+ var _a, _b;
12583
+ const form = useForm({
12584
+ defaultValues: {
12585
+ customer_id: order.customer_id || ""
12586
+ },
12587
+ resolver: zodResolver(schema)
12520
12588
  });
12521
12589
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12522
12590
  const { handleSuccess } = useRouteModal();
@@ -12966,76 +13034,8 @@ const Illustration = () => {
12966
13034
  }
12967
13035
  );
12968
13036
  };
12969
- const schema$1 = objectType({
12970
- customer_id: stringType().min(1)
12971
- });
12972
- const Email = () => {
12973
- const { id } = useParams();
12974
- const { order, isPending, isError, error } = useOrder(id, {
12975
- fields: "+email"
12976
- });
12977
- if (isError) {
12978
- throw error;
12979
- }
12980
- const isReady = !isPending && !!order;
12981
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
12982
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
12983
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Email" }) }),
12984
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
12985
- ] }),
12986
- isReady && /* @__PURE__ */ jsx(EmailForm, { order })
12987
- ] });
12988
- };
12989
- const EmailForm = ({ order }) => {
12990
- const form = useForm({
12991
- defaultValues: {
12992
- email: order.email ?? ""
12993
- },
12994
- resolver: zodResolver(schema)
12995
- });
12996
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12997
- const { handleSuccess } = useRouteModal();
12998
- const onSubmit = form.handleSubmit(async (data) => {
12999
- await mutateAsync(
13000
- { email: data.email },
13001
- {
13002
- onSuccess: () => {
13003
- handleSuccess();
13004
- },
13005
- onError: (error) => {
13006
- toast.error(error.message);
13007
- }
13008
- }
13009
- );
13010
- });
13011
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
13012
- KeyboundForm,
13013
- {
13014
- className: "flex flex-1 flex-col overflow-hidden",
13015
- onSubmit,
13016
- children: [
13017
- /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
13018
- Form$2.Field,
13019
- {
13020
- control: form.control,
13021
- name: "email",
13022
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
13023
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Email" }),
13024
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
13025
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
13026
- ] })
13027
- }
13028
- ) }),
13029
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
13030
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
13031
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
13032
- ] }) })
13033
- ]
13034
- }
13035
- ) });
13036
- };
13037
13037
  const schema = objectType({
13038
- email: stringType().email()
13038
+ customer_id: stringType().min(1)
13039
13039
  });
13040
13040
  const widgetModule = { widgets: [] };
13041
13041
  const routeModule = {
@@ -13065,6 +13065,10 @@ const routeModule = {
13065
13065
  Component: CustomItems,
13066
13066
  path: "/draft-orders/:id/custom-items"
13067
13067
  },
13068
+ {
13069
+ Component: Email,
13070
+ path: "/draft-orders/:id/email"
13071
+ },
13068
13072
  {
13069
13073
  Component: Items,
13070
13074
  path: "/draft-orders/:id/items"
@@ -13081,21 +13085,17 @@ const routeModule = {
13081
13085
  Component: SalesChannel,
13082
13086
  path: "/draft-orders/:id/sales-channel"
13083
13087
  },
13084
- {
13085
- Component: ShippingAddress,
13086
- path: "/draft-orders/:id/shipping-address"
13087
- },
13088
13088
  {
13089
13089
  Component: Shipping,
13090
13090
  path: "/draft-orders/:id/shipping"
13091
13091
  },
13092
13092
  {
13093
- Component: TransferOwnership,
13094
- path: "/draft-orders/:id/transfer-ownership"
13093
+ Component: ShippingAddress,
13094
+ path: "/draft-orders/:id/shipping-address"
13095
13095
  },
13096
13096
  {
13097
- Component: Email,
13098
- path: "/draft-orders/:id/email"
13097
+ Component: TransferOwnership,
13098
+ path: "/draft-orders/:id/transfer-ownership"
13099
13099
  }
13100
13100
  ]
13101
13101
  }