@medusajs/draft-order 2.11.2-preview-20251029210154 → 2.11.2-preview-20251030000332
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.
- package/.medusa/server/src/admin/index.js +78 -78
- package/.medusa/server/src/admin/index.mjs +78 -78
- package/package.json +16 -16
|
@@ -9782,74 +9782,6 @@ const CustomItemsForm = () => {
|
|
|
9782
9782
|
const schema$4 = objectType({
|
|
9783
9783
|
email: stringType().email()
|
|
9784
9784
|
});
|
|
9785
|
-
const Email = () => {
|
|
9786
|
-
const { id } = reactRouterDom.useParams();
|
|
9787
|
-
const { order, isPending, isError, error } = useOrder(id, {
|
|
9788
|
-
fields: "+email"
|
|
9789
|
-
});
|
|
9790
|
-
if (isError) {
|
|
9791
|
-
throw error;
|
|
9792
|
-
}
|
|
9793
|
-
const isReady = !isPending && !!order;
|
|
9794
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
9795
|
-
/* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
|
|
9796
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Email" }) }),
|
|
9797
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
|
|
9798
|
-
] }),
|
|
9799
|
-
isReady && /* @__PURE__ */ jsxRuntime.jsx(EmailForm, { order })
|
|
9800
|
-
] });
|
|
9801
|
-
};
|
|
9802
|
-
const EmailForm = ({ order }) => {
|
|
9803
|
-
const form = reactHookForm.useForm({
|
|
9804
|
-
defaultValues: {
|
|
9805
|
-
email: order.email ?? ""
|
|
9806
|
-
},
|
|
9807
|
-
resolver: zod.zodResolver(schema$3)
|
|
9808
|
-
});
|
|
9809
|
-
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
9810
|
-
const { handleSuccess } = useRouteModal();
|
|
9811
|
-
const onSubmit = form.handleSubmit(async (data) => {
|
|
9812
|
-
await mutateAsync(
|
|
9813
|
-
{ email: data.email },
|
|
9814
|
-
{
|
|
9815
|
-
onSuccess: () => {
|
|
9816
|
-
handleSuccess();
|
|
9817
|
-
},
|
|
9818
|
-
onError: (error) => {
|
|
9819
|
-
ui.toast.error(error.message);
|
|
9820
|
-
}
|
|
9821
|
-
}
|
|
9822
|
-
);
|
|
9823
|
-
});
|
|
9824
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9825
|
-
KeyboundForm,
|
|
9826
|
-
{
|
|
9827
|
-
className: "flex flex-1 flex-col overflow-hidden",
|
|
9828
|
-
onSubmit,
|
|
9829
|
-
children: [
|
|
9830
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9831
|
-
Form$2.Field,
|
|
9832
|
-
{
|
|
9833
|
-
control: form.control,
|
|
9834
|
-
name: "email",
|
|
9835
|
-
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
9836
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Email" }),
|
|
9837
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
9838
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
9839
|
-
] })
|
|
9840
|
-
}
|
|
9841
|
-
) }),
|
|
9842
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9843
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9844
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
|
|
9845
|
-
] }) })
|
|
9846
|
-
]
|
|
9847
|
-
}
|
|
9848
|
-
) });
|
|
9849
|
-
};
|
|
9850
|
-
const schema$3 = objectType({
|
|
9851
|
-
email: stringType().email()
|
|
9852
|
-
});
|
|
9853
9785
|
const NumberInput = React.forwardRef(
|
|
9854
9786
|
({
|
|
9855
9787
|
value,
|
|
@@ -11479,7 +11411,7 @@ const SalesChannelForm = ({ order }) => {
|
|
|
11479
11411
|
defaultValues: {
|
|
11480
11412
|
sales_channel_id: order.sales_channel_id || ""
|
|
11481
11413
|
},
|
|
11482
|
-
resolver: zod.zodResolver(schema$
|
|
11414
|
+
resolver: zod.zodResolver(schema$3)
|
|
11483
11415
|
});
|
|
11484
11416
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
11485
11417
|
const { handleSuccess } = useRouteModal();
|
|
@@ -11554,7 +11486,7 @@ const SalesChannelField = ({ control, order }) => {
|
|
|
11554
11486
|
}
|
|
11555
11487
|
);
|
|
11556
11488
|
};
|
|
11557
|
-
const schema$
|
|
11489
|
+
const schema$3 = objectType({
|
|
11558
11490
|
sales_channel_id: stringType().min(1)
|
|
11559
11491
|
});
|
|
11560
11492
|
const STACKED_FOCUS_MODAL_ID = "shipping-form";
|
|
@@ -12396,7 +12328,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12396
12328
|
postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
|
|
12397
12329
|
phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
|
|
12398
12330
|
},
|
|
12399
|
-
resolver: zod.zodResolver(schema$
|
|
12331
|
+
resolver: zod.zodResolver(schema$2)
|
|
12400
12332
|
});
|
|
12401
12333
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12402
12334
|
const { handleSuccess } = useRouteModal();
|
|
@@ -12566,7 +12498,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12566
12498
|
}
|
|
12567
12499
|
) });
|
|
12568
12500
|
};
|
|
12569
|
-
const schema$
|
|
12501
|
+
const schema$2 = addressSchema;
|
|
12570
12502
|
const TransferOwnership = () => {
|
|
12571
12503
|
const { id } = reactRouterDom.useParams();
|
|
12572
12504
|
const { draft_order, isPending, isError, error } = useDraftOrder(id, {
|
|
@@ -12590,7 +12522,7 @@ const TransferOwnershipForm = ({ order }) => {
|
|
|
12590
12522
|
defaultValues: {
|
|
12591
12523
|
customer_id: order.customer_id || ""
|
|
12592
12524
|
},
|
|
12593
|
-
resolver: zod.zodResolver(schema)
|
|
12525
|
+
resolver: zod.zodResolver(schema$1)
|
|
12594
12526
|
});
|
|
12595
12527
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12596
12528
|
const { handleSuccess } = useRouteModal();
|
|
@@ -13040,9 +12972,77 @@ const Illustration = () => {
|
|
|
13040
12972
|
}
|
|
13041
12973
|
);
|
|
13042
12974
|
};
|
|
13043
|
-
const schema = objectType({
|
|
12975
|
+
const schema$1 = objectType({
|
|
13044
12976
|
customer_id: stringType().min(1)
|
|
13045
12977
|
});
|
|
12978
|
+
const Email = () => {
|
|
12979
|
+
const { id } = reactRouterDom.useParams();
|
|
12980
|
+
const { order, isPending, isError, error } = useOrder(id, {
|
|
12981
|
+
fields: "+email"
|
|
12982
|
+
});
|
|
12983
|
+
if (isError) {
|
|
12984
|
+
throw error;
|
|
12985
|
+
}
|
|
12986
|
+
const isReady = !isPending && !!order;
|
|
12987
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
12988
|
+
/* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
|
|
12989
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Email" }) }),
|
|
12990
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
|
|
12991
|
+
] }),
|
|
12992
|
+
isReady && /* @__PURE__ */ jsxRuntime.jsx(EmailForm, { order })
|
|
12993
|
+
] });
|
|
12994
|
+
};
|
|
12995
|
+
const EmailForm = ({ order }) => {
|
|
12996
|
+
const form = reactHookForm.useForm({
|
|
12997
|
+
defaultValues: {
|
|
12998
|
+
email: order.email ?? ""
|
|
12999
|
+
},
|
|
13000
|
+
resolver: zod.zodResolver(schema)
|
|
13001
|
+
});
|
|
13002
|
+
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
13003
|
+
const { handleSuccess } = useRouteModal();
|
|
13004
|
+
const onSubmit = form.handleSubmit(async (data) => {
|
|
13005
|
+
await mutateAsync(
|
|
13006
|
+
{ email: data.email },
|
|
13007
|
+
{
|
|
13008
|
+
onSuccess: () => {
|
|
13009
|
+
handleSuccess();
|
|
13010
|
+
},
|
|
13011
|
+
onError: (error) => {
|
|
13012
|
+
ui.toast.error(error.message);
|
|
13013
|
+
}
|
|
13014
|
+
}
|
|
13015
|
+
);
|
|
13016
|
+
});
|
|
13017
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13018
|
+
KeyboundForm,
|
|
13019
|
+
{
|
|
13020
|
+
className: "flex flex-1 flex-col overflow-hidden",
|
|
13021
|
+
onSubmit,
|
|
13022
|
+
children: [
|
|
13023
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13024
|
+
Form$2.Field,
|
|
13025
|
+
{
|
|
13026
|
+
control: form.control,
|
|
13027
|
+
name: "email",
|
|
13028
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
13029
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Email" }),
|
|
13030
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
13031
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
13032
|
+
] })
|
|
13033
|
+
}
|
|
13034
|
+
) }),
|
|
13035
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
13036
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
13037
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
|
|
13038
|
+
] }) })
|
|
13039
|
+
]
|
|
13040
|
+
}
|
|
13041
|
+
) });
|
|
13042
|
+
};
|
|
13043
|
+
const schema = objectType({
|
|
13044
|
+
email: stringType().email()
|
|
13045
|
+
});
|
|
13046
13046
|
const widgetModule = { widgets: [] };
|
|
13047
13047
|
const routeModule = {
|
|
13048
13048
|
routes: [
|
|
@@ -13071,10 +13071,6 @@ const routeModule = {
|
|
|
13071
13071
|
Component: CustomItems,
|
|
13072
13072
|
path: "/draft-orders/:id/custom-items"
|
|
13073
13073
|
},
|
|
13074
|
-
{
|
|
13075
|
-
Component: Email,
|
|
13076
|
-
path: "/draft-orders/:id/email"
|
|
13077
|
-
},
|
|
13078
13074
|
{
|
|
13079
13075
|
Component: Items,
|
|
13080
13076
|
path: "/draft-orders/:id/items"
|
|
@@ -13102,6 +13098,10 @@ const routeModule = {
|
|
|
13102
13098
|
{
|
|
13103
13099
|
Component: TransferOwnership,
|
|
13104
13100
|
path: "/draft-orders/:id/transfer-ownership"
|
|
13101
|
+
},
|
|
13102
|
+
{
|
|
13103
|
+
Component: Email,
|
|
13104
|
+
path: "/draft-orders/:id/email"
|
|
13105
13105
|
}
|
|
13106
13106
|
]
|
|
13107
13107
|
}
|
|
@@ -9776,74 +9776,6 @@ 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
|
-
});
|
|
9847
9779
|
const NumberInput = forwardRef(
|
|
9848
9780
|
({
|
|
9849
9781
|
value,
|
|
@@ -11473,7 +11405,7 @@ const SalesChannelForm = ({ order }) => {
|
|
|
11473
11405
|
defaultValues: {
|
|
11474
11406
|
sales_channel_id: order.sales_channel_id || ""
|
|
11475
11407
|
},
|
|
11476
|
-
resolver: zodResolver(schema$
|
|
11408
|
+
resolver: zodResolver(schema$3)
|
|
11477
11409
|
});
|
|
11478
11410
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
11479
11411
|
const { handleSuccess } = useRouteModal();
|
|
@@ -11548,7 +11480,7 @@ const SalesChannelField = ({ control, order }) => {
|
|
|
11548
11480
|
}
|
|
11549
11481
|
);
|
|
11550
11482
|
};
|
|
11551
|
-
const schema$
|
|
11483
|
+
const schema$3 = objectType({
|
|
11552
11484
|
sales_channel_id: stringType().min(1)
|
|
11553
11485
|
});
|
|
11554
11486
|
const STACKED_FOCUS_MODAL_ID = "shipping-form";
|
|
@@ -12390,7 +12322,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12390
12322
|
postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
|
|
12391
12323
|
phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
|
|
12392
12324
|
},
|
|
12393
|
-
resolver: zodResolver(schema$
|
|
12325
|
+
resolver: zodResolver(schema$2)
|
|
12394
12326
|
});
|
|
12395
12327
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12396
12328
|
const { handleSuccess } = useRouteModal();
|
|
@@ -12560,7 +12492,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12560
12492
|
}
|
|
12561
12493
|
) });
|
|
12562
12494
|
};
|
|
12563
|
-
const schema$
|
|
12495
|
+
const schema$2 = addressSchema;
|
|
12564
12496
|
const TransferOwnership = () => {
|
|
12565
12497
|
const { id } = useParams();
|
|
12566
12498
|
const { draft_order, isPending, isError, error } = useDraftOrder(id, {
|
|
@@ -12584,7 +12516,7 @@ const TransferOwnershipForm = ({ order }) => {
|
|
|
12584
12516
|
defaultValues: {
|
|
12585
12517
|
customer_id: order.customer_id || ""
|
|
12586
12518
|
},
|
|
12587
|
-
resolver: zodResolver(schema)
|
|
12519
|
+
resolver: zodResolver(schema$1)
|
|
12588
12520
|
});
|
|
12589
12521
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12590
12522
|
const { handleSuccess } = useRouteModal();
|
|
@@ -13034,9 +12966,77 @@ const Illustration = () => {
|
|
|
13034
12966
|
}
|
|
13035
12967
|
);
|
|
13036
12968
|
};
|
|
13037
|
-
const schema = objectType({
|
|
12969
|
+
const schema$1 = objectType({
|
|
13038
12970
|
customer_id: stringType().min(1)
|
|
13039
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
|
+
const schema = objectType({
|
|
13038
|
+
email: stringType().email()
|
|
13039
|
+
});
|
|
13040
13040
|
const widgetModule = { widgets: [] };
|
|
13041
13041
|
const routeModule = {
|
|
13042
13042
|
routes: [
|
|
@@ -13065,10 +13065,6 @@ 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
|
-
},
|
|
13072
13068
|
{
|
|
13073
13069
|
Component: Items,
|
|
13074
13070
|
path: "/draft-orders/:id/items"
|
|
@@ -13096,6 +13092,10 @@ const routeModule = {
|
|
|
13096
13092
|
{
|
|
13097
13093
|
Component: TransferOwnership,
|
|
13098
13094
|
path: "/draft-orders/:id/transfer-ownership"
|
|
13095
|
+
},
|
|
13096
|
+
{
|
|
13097
|
+
Component: Email,
|
|
13098
|
+
path: "/draft-orders/:id/email"
|
|
13099
13099
|
}
|
|
13100
13100
|
]
|
|
13101
13101
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/draft-order",
|
|
3
|
-
"version": "2.11.2-preview-
|
|
3
|
+
"version": "2.11.2-preview-20251030000332",
|
|
4
4
|
"description": "A starter for Medusa plugins.",
|
|
5
5
|
"author": "Medusa (https://medusajs.com)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@ariakit/react": "^0.4.15",
|
|
38
38
|
"@hookform/resolvers": "3.4.2",
|
|
39
|
-
"@medusajs/js-sdk": "2.11.2-preview-
|
|
39
|
+
"@medusajs/js-sdk": "2.11.2-preview-20251030000332",
|
|
40
40
|
"@tanstack/react-query": "5.64.2",
|
|
41
41
|
"@uiw/react-json-view": "^2.0.0-alpha.17",
|
|
42
42
|
"date-fns": "^3.6.0",
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
"react-hook-form": "7.49.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@medusajs/admin-sdk": "2.11.2-preview-
|
|
49
|
-
"@medusajs/cli": "2.11.2-preview-
|
|
50
|
-
"@medusajs/framework": "2.11.2-preview-
|
|
51
|
-
"@medusajs/icons": "2.11.2-preview-
|
|
52
|
-
"@medusajs/test-utils": "2.11.2-preview-
|
|
53
|
-
"@medusajs/types": "2.11.2-preview-
|
|
54
|
-
"@medusajs/ui": "4.0.26-preview-
|
|
55
|
-
"@medusajs/ui-preset": "2.11.2-preview-
|
|
48
|
+
"@medusajs/admin-sdk": "2.11.2-preview-20251030000332",
|
|
49
|
+
"@medusajs/cli": "2.11.2-preview-20251030000332",
|
|
50
|
+
"@medusajs/framework": "2.11.2-preview-20251030000332",
|
|
51
|
+
"@medusajs/icons": "2.11.2-preview-20251030000332",
|
|
52
|
+
"@medusajs/test-utils": "2.11.2-preview-20251030000332",
|
|
53
|
+
"@medusajs/types": "2.11.2-preview-20251030000332",
|
|
54
|
+
"@medusajs/ui": "4.0.26-preview-20251030000332",
|
|
55
|
+
"@medusajs/ui-preset": "2.11.2-preview-20251030000332",
|
|
56
56
|
"@swc/core": "1.5.7",
|
|
57
57
|
"@types/lodash": "^4.17.15",
|
|
58
58
|
"@types/node": "^20.0.0",
|
|
@@ -69,12 +69,12 @@
|
|
|
69
69
|
"yalc": "^1.0.0-pre.53"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"@medusajs/admin-sdk": "2.11.2-preview-
|
|
73
|
-
"@medusajs/cli": "2.11.2-preview-
|
|
74
|
-
"@medusajs/framework": "2.11.2-preview-
|
|
75
|
-
"@medusajs/icons": "2.11.2-preview-
|
|
76
|
-
"@medusajs/test-utils": "2.11.2-preview-
|
|
77
|
-
"@medusajs/ui": "4.0.26-preview-
|
|
72
|
+
"@medusajs/admin-sdk": "2.11.2-preview-20251030000332",
|
|
73
|
+
"@medusajs/cli": "2.11.2-preview-20251030000332",
|
|
74
|
+
"@medusajs/framework": "2.11.2-preview-20251030000332",
|
|
75
|
+
"@medusajs/icons": "2.11.2-preview-20251030000332",
|
|
76
|
+
"@medusajs/test-utils": "2.11.2-preview-20251030000332",
|
|
77
|
+
"@medusajs/ui": "4.0.26-preview-20251030000332",
|
|
78
78
|
"lodash": "^4.17.21",
|
|
79
79
|
"react-router-dom": "6.20.1"
|
|
80
80
|
},
|