@medusajs/draft-order 2.10.4-preview-20250924180206 → 2.10.4-preview-20250924210149
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
|
@@ -9784,74 +9784,6 @@ const CustomItemsForm = () => {
|
|
|
9784
9784
|
const schema$4 = objectType({
|
|
9785
9785
|
email: stringType().email()
|
|
9786
9786
|
});
|
|
9787
|
-
const Email = () => {
|
|
9788
|
-
const { id } = reactRouterDom.useParams();
|
|
9789
|
-
const { order, isPending, isError, error } = useOrder(id, {
|
|
9790
|
-
fields: "+email"
|
|
9791
|
-
});
|
|
9792
|
-
if (isError) {
|
|
9793
|
-
throw error;
|
|
9794
|
-
}
|
|
9795
|
-
const isReady = !isPending && !!order;
|
|
9796
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
9797
|
-
/* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
|
|
9798
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Email" }) }),
|
|
9799
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
|
|
9800
|
-
] }),
|
|
9801
|
-
isReady && /* @__PURE__ */ jsxRuntime.jsx(EmailForm, { order })
|
|
9802
|
-
] });
|
|
9803
|
-
};
|
|
9804
|
-
const EmailForm = ({ order }) => {
|
|
9805
|
-
const form = reactHookForm.useForm({
|
|
9806
|
-
defaultValues: {
|
|
9807
|
-
email: order.email ?? ""
|
|
9808
|
-
},
|
|
9809
|
-
resolver: zod.zodResolver(schema$3)
|
|
9810
|
-
});
|
|
9811
|
-
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
9812
|
-
const { handleSuccess } = useRouteModal();
|
|
9813
|
-
const onSubmit = form.handleSubmit(async (data) => {
|
|
9814
|
-
await mutateAsync(
|
|
9815
|
-
{ email: data.email },
|
|
9816
|
-
{
|
|
9817
|
-
onSuccess: () => {
|
|
9818
|
-
handleSuccess();
|
|
9819
|
-
},
|
|
9820
|
-
onError: (error) => {
|
|
9821
|
-
ui.toast.error(error.message);
|
|
9822
|
-
}
|
|
9823
|
-
}
|
|
9824
|
-
);
|
|
9825
|
-
});
|
|
9826
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9827
|
-
KeyboundForm,
|
|
9828
|
-
{
|
|
9829
|
-
className: "flex flex-1 flex-col overflow-hidden",
|
|
9830
|
-
onSubmit,
|
|
9831
|
-
children: [
|
|
9832
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9833
|
-
Form$2.Field,
|
|
9834
|
-
{
|
|
9835
|
-
control: form.control,
|
|
9836
|
-
name: "email",
|
|
9837
|
-
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
9838
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Email" }),
|
|
9839
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
9840
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
9841
|
-
] })
|
|
9842
|
-
}
|
|
9843
|
-
) }),
|
|
9844
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9845
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9846
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
|
|
9847
|
-
] }) })
|
|
9848
|
-
]
|
|
9849
|
-
}
|
|
9850
|
-
) });
|
|
9851
|
-
};
|
|
9852
|
-
const schema$3 = objectType({
|
|
9853
|
-
email: stringType().email()
|
|
9854
|
-
});
|
|
9855
9787
|
const NumberInput = React.forwardRef(
|
|
9856
9788
|
({
|
|
9857
9789
|
value,
|
|
@@ -11481,7 +11413,7 @@ const SalesChannelForm = ({ order }) => {
|
|
|
11481
11413
|
defaultValues: {
|
|
11482
11414
|
sales_channel_id: order.sales_channel_id || ""
|
|
11483
11415
|
},
|
|
11484
|
-
resolver: zod.zodResolver(schema$
|
|
11416
|
+
resolver: zod.zodResolver(schema$3)
|
|
11485
11417
|
});
|
|
11486
11418
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
11487
11419
|
const { handleSuccess } = useRouteModal();
|
|
@@ -11556,7 +11488,7 @@ const SalesChannelField = ({ control, order }) => {
|
|
|
11556
11488
|
}
|
|
11557
11489
|
);
|
|
11558
11490
|
};
|
|
11559
|
-
const schema$
|
|
11491
|
+
const schema$3 = objectType({
|
|
11560
11492
|
sales_channel_id: stringType().min(1)
|
|
11561
11493
|
});
|
|
11562
11494
|
const STACKED_FOCUS_MODAL_ID = "shipping-form";
|
|
@@ -12398,7 +12330,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12398
12330
|
postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
|
|
12399
12331
|
phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
|
|
12400
12332
|
},
|
|
12401
|
-
resolver: zod.zodResolver(schema$
|
|
12333
|
+
resolver: zod.zodResolver(schema$2)
|
|
12402
12334
|
});
|
|
12403
12335
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12404
12336
|
const { handleSuccess } = useRouteModal();
|
|
@@ -12568,7 +12500,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12568
12500
|
}
|
|
12569
12501
|
) });
|
|
12570
12502
|
};
|
|
12571
|
-
const schema$
|
|
12503
|
+
const schema$2 = addressSchema;
|
|
12572
12504
|
const TransferOwnership = () => {
|
|
12573
12505
|
const { id } = reactRouterDom.useParams();
|
|
12574
12506
|
const { draft_order, isPending, isError, error } = useDraftOrder(id, {
|
|
@@ -12592,7 +12524,7 @@ const TransferOwnershipForm = ({ order }) => {
|
|
|
12592
12524
|
defaultValues: {
|
|
12593
12525
|
customer_id: order.customer_id || ""
|
|
12594
12526
|
},
|
|
12595
|
-
resolver: zod.zodResolver(schema)
|
|
12527
|
+
resolver: zod.zodResolver(schema$1)
|
|
12596
12528
|
});
|
|
12597
12529
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12598
12530
|
const { handleSuccess } = useRouteModal();
|
|
@@ -13042,9 +12974,77 @@ const Illustration = () => {
|
|
|
13042
12974
|
}
|
|
13043
12975
|
);
|
|
13044
12976
|
};
|
|
13045
|
-
const schema = objectType({
|
|
12977
|
+
const schema$1 = objectType({
|
|
13046
12978
|
customer_id: stringType().min(1)
|
|
13047
12979
|
});
|
|
12980
|
+
const Email = () => {
|
|
12981
|
+
const { id } = reactRouterDom.useParams();
|
|
12982
|
+
const { order, isPending, isError, error } = useOrder(id, {
|
|
12983
|
+
fields: "+email"
|
|
12984
|
+
});
|
|
12985
|
+
if (isError) {
|
|
12986
|
+
throw error;
|
|
12987
|
+
}
|
|
12988
|
+
const isReady = !isPending && !!order;
|
|
12989
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
12990
|
+
/* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
|
|
12991
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Email" }) }),
|
|
12992
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
|
|
12993
|
+
] }),
|
|
12994
|
+
isReady && /* @__PURE__ */ jsxRuntime.jsx(EmailForm, { order })
|
|
12995
|
+
] });
|
|
12996
|
+
};
|
|
12997
|
+
const EmailForm = ({ order }) => {
|
|
12998
|
+
const form = reactHookForm.useForm({
|
|
12999
|
+
defaultValues: {
|
|
13000
|
+
email: order.email ?? ""
|
|
13001
|
+
},
|
|
13002
|
+
resolver: zod.zodResolver(schema)
|
|
13003
|
+
});
|
|
13004
|
+
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
13005
|
+
const { handleSuccess } = useRouteModal();
|
|
13006
|
+
const onSubmit = form.handleSubmit(async (data) => {
|
|
13007
|
+
await mutateAsync(
|
|
13008
|
+
{ email: data.email },
|
|
13009
|
+
{
|
|
13010
|
+
onSuccess: () => {
|
|
13011
|
+
handleSuccess();
|
|
13012
|
+
},
|
|
13013
|
+
onError: (error) => {
|
|
13014
|
+
ui.toast.error(error.message);
|
|
13015
|
+
}
|
|
13016
|
+
}
|
|
13017
|
+
);
|
|
13018
|
+
});
|
|
13019
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13020
|
+
KeyboundForm,
|
|
13021
|
+
{
|
|
13022
|
+
className: "flex flex-1 flex-col overflow-hidden",
|
|
13023
|
+
onSubmit,
|
|
13024
|
+
children: [
|
|
13025
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13026
|
+
Form$2.Field,
|
|
13027
|
+
{
|
|
13028
|
+
control: form.control,
|
|
13029
|
+
name: "email",
|
|
13030
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
13031
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Email" }),
|
|
13032
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
13033
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
13034
|
+
] })
|
|
13035
|
+
}
|
|
13036
|
+
) }),
|
|
13037
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
13038
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
13039
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
|
|
13040
|
+
] }) })
|
|
13041
|
+
]
|
|
13042
|
+
}
|
|
13043
|
+
) });
|
|
13044
|
+
};
|
|
13045
|
+
const schema = objectType({
|
|
13046
|
+
email: stringType().email()
|
|
13047
|
+
});
|
|
13048
13048
|
const widgetModule = { widgets: [] };
|
|
13049
13049
|
const routeModule = {
|
|
13050
13050
|
routes: [
|
|
@@ -13073,10 +13073,6 @@ const routeModule = {
|
|
|
13073
13073
|
Component: CustomItems,
|
|
13074
13074
|
path: "/draft-orders/:id/custom-items"
|
|
13075
13075
|
},
|
|
13076
|
-
{
|
|
13077
|
-
Component: Email,
|
|
13078
|
-
path: "/draft-orders/:id/email"
|
|
13079
|
-
},
|
|
13080
13076
|
{
|
|
13081
13077
|
Component: Items,
|
|
13082
13078
|
path: "/draft-orders/:id/items"
|
|
@@ -13104,6 +13100,10 @@ const routeModule = {
|
|
|
13104
13100
|
{
|
|
13105
13101
|
Component: TransferOwnership,
|
|
13106
13102
|
path: "/draft-orders/:id/transfer-ownership"
|
|
13103
|
+
},
|
|
13104
|
+
{
|
|
13105
|
+
Component: Email,
|
|
13106
|
+
path: "/draft-orders/:id/email"
|
|
13107
13107
|
}
|
|
13108
13108
|
]
|
|
13109
13109
|
}
|
|
@@ -9778,74 +9778,6 @@ const CustomItemsForm = () => {
|
|
|
9778
9778
|
const schema$4 = objectType({
|
|
9779
9779
|
email: stringType().email()
|
|
9780
9780
|
});
|
|
9781
|
-
const Email = () => {
|
|
9782
|
-
const { id } = useParams();
|
|
9783
|
-
const { order, isPending, isError, error } = useOrder(id, {
|
|
9784
|
-
fields: "+email"
|
|
9785
|
-
});
|
|
9786
|
-
if (isError) {
|
|
9787
|
-
throw error;
|
|
9788
|
-
}
|
|
9789
|
-
const isReady = !isPending && !!order;
|
|
9790
|
-
return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
|
|
9791
|
-
/* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
|
|
9792
|
-
/* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Email" }) }),
|
|
9793
|
-
/* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
|
|
9794
|
-
] }),
|
|
9795
|
-
isReady && /* @__PURE__ */ jsx(EmailForm, { order })
|
|
9796
|
-
] });
|
|
9797
|
-
};
|
|
9798
|
-
const EmailForm = ({ order }) => {
|
|
9799
|
-
const form = useForm({
|
|
9800
|
-
defaultValues: {
|
|
9801
|
-
email: order.email ?? ""
|
|
9802
|
-
},
|
|
9803
|
-
resolver: zodResolver(schema$3)
|
|
9804
|
-
});
|
|
9805
|
-
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
9806
|
-
const { handleSuccess } = useRouteModal();
|
|
9807
|
-
const onSubmit = form.handleSubmit(async (data) => {
|
|
9808
|
-
await mutateAsync(
|
|
9809
|
-
{ email: data.email },
|
|
9810
|
-
{
|
|
9811
|
-
onSuccess: () => {
|
|
9812
|
-
handleSuccess();
|
|
9813
|
-
},
|
|
9814
|
-
onError: (error) => {
|
|
9815
|
-
toast.error(error.message);
|
|
9816
|
-
}
|
|
9817
|
-
}
|
|
9818
|
-
);
|
|
9819
|
-
});
|
|
9820
|
-
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
|
|
9821
|
-
KeyboundForm,
|
|
9822
|
-
{
|
|
9823
|
-
className: "flex flex-1 flex-col overflow-hidden",
|
|
9824
|
-
onSubmit,
|
|
9825
|
-
children: [
|
|
9826
|
-
/* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
|
|
9827
|
-
Form$2.Field,
|
|
9828
|
-
{
|
|
9829
|
-
control: form.control,
|
|
9830
|
-
name: "email",
|
|
9831
|
-
render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
|
|
9832
|
-
/* @__PURE__ */ jsx(Form$2.Label, { children: "Email" }),
|
|
9833
|
-
/* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
9834
|
-
/* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
|
|
9835
|
-
] })
|
|
9836
|
-
}
|
|
9837
|
-
) }),
|
|
9838
|
-
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9839
|
-
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9840
|
-
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
|
|
9841
|
-
] }) })
|
|
9842
|
-
]
|
|
9843
|
-
}
|
|
9844
|
-
) });
|
|
9845
|
-
};
|
|
9846
|
-
const schema$3 = objectType({
|
|
9847
|
-
email: stringType().email()
|
|
9848
|
-
});
|
|
9849
9781
|
const NumberInput = forwardRef(
|
|
9850
9782
|
({
|
|
9851
9783
|
value,
|
|
@@ -11475,7 +11407,7 @@ const SalesChannelForm = ({ order }) => {
|
|
|
11475
11407
|
defaultValues: {
|
|
11476
11408
|
sales_channel_id: order.sales_channel_id || ""
|
|
11477
11409
|
},
|
|
11478
|
-
resolver: zodResolver(schema$
|
|
11410
|
+
resolver: zodResolver(schema$3)
|
|
11479
11411
|
});
|
|
11480
11412
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
11481
11413
|
const { handleSuccess } = useRouteModal();
|
|
@@ -11550,7 +11482,7 @@ const SalesChannelField = ({ control, order }) => {
|
|
|
11550
11482
|
}
|
|
11551
11483
|
);
|
|
11552
11484
|
};
|
|
11553
|
-
const schema$
|
|
11485
|
+
const schema$3 = objectType({
|
|
11554
11486
|
sales_channel_id: stringType().min(1)
|
|
11555
11487
|
});
|
|
11556
11488
|
const STACKED_FOCUS_MODAL_ID = "shipping-form";
|
|
@@ -12392,7 +12324,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12392
12324
|
postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
|
|
12393
12325
|
phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
|
|
12394
12326
|
},
|
|
12395
|
-
resolver: zodResolver(schema$
|
|
12327
|
+
resolver: zodResolver(schema$2)
|
|
12396
12328
|
});
|
|
12397
12329
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12398
12330
|
const { handleSuccess } = useRouteModal();
|
|
@@ -12562,7 +12494,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12562
12494
|
}
|
|
12563
12495
|
) });
|
|
12564
12496
|
};
|
|
12565
|
-
const schema$
|
|
12497
|
+
const schema$2 = addressSchema;
|
|
12566
12498
|
const TransferOwnership = () => {
|
|
12567
12499
|
const { id } = useParams();
|
|
12568
12500
|
const { draft_order, isPending, isError, error } = useDraftOrder(id, {
|
|
@@ -12586,7 +12518,7 @@ const TransferOwnershipForm = ({ order }) => {
|
|
|
12586
12518
|
defaultValues: {
|
|
12587
12519
|
customer_id: order.customer_id || ""
|
|
12588
12520
|
},
|
|
12589
|
-
resolver: zodResolver(schema)
|
|
12521
|
+
resolver: zodResolver(schema$1)
|
|
12590
12522
|
});
|
|
12591
12523
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12592
12524
|
const { handleSuccess } = useRouteModal();
|
|
@@ -13036,9 +12968,77 @@ const Illustration = () => {
|
|
|
13036
12968
|
}
|
|
13037
12969
|
);
|
|
13038
12970
|
};
|
|
13039
|
-
const schema = objectType({
|
|
12971
|
+
const schema$1 = objectType({
|
|
13040
12972
|
customer_id: stringType().min(1)
|
|
13041
12973
|
});
|
|
12974
|
+
const Email = () => {
|
|
12975
|
+
const { id } = useParams();
|
|
12976
|
+
const { order, isPending, isError, error } = useOrder(id, {
|
|
12977
|
+
fields: "+email"
|
|
12978
|
+
});
|
|
12979
|
+
if (isError) {
|
|
12980
|
+
throw error;
|
|
12981
|
+
}
|
|
12982
|
+
const isReady = !isPending && !!order;
|
|
12983
|
+
return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
|
|
12984
|
+
/* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
|
|
12985
|
+
/* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Email" }) }),
|
|
12986
|
+
/* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
|
|
12987
|
+
] }),
|
|
12988
|
+
isReady && /* @__PURE__ */ jsx(EmailForm, { order })
|
|
12989
|
+
] });
|
|
12990
|
+
};
|
|
12991
|
+
const EmailForm = ({ order }) => {
|
|
12992
|
+
const form = useForm({
|
|
12993
|
+
defaultValues: {
|
|
12994
|
+
email: order.email ?? ""
|
|
12995
|
+
},
|
|
12996
|
+
resolver: zodResolver(schema)
|
|
12997
|
+
});
|
|
12998
|
+
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12999
|
+
const { handleSuccess } = useRouteModal();
|
|
13000
|
+
const onSubmit = form.handleSubmit(async (data) => {
|
|
13001
|
+
await mutateAsync(
|
|
13002
|
+
{ email: data.email },
|
|
13003
|
+
{
|
|
13004
|
+
onSuccess: () => {
|
|
13005
|
+
handleSuccess();
|
|
13006
|
+
},
|
|
13007
|
+
onError: (error) => {
|
|
13008
|
+
toast.error(error.message);
|
|
13009
|
+
}
|
|
13010
|
+
}
|
|
13011
|
+
);
|
|
13012
|
+
});
|
|
13013
|
+
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
|
|
13014
|
+
KeyboundForm,
|
|
13015
|
+
{
|
|
13016
|
+
className: "flex flex-1 flex-col overflow-hidden",
|
|
13017
|
+
onSubmit,
|
|
13018
|
+
children: [
|
|
13019
|
+
/* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
|
|
13020
|
+
Form$2.Field,
|
|
13021
|
+
{
|
|
13022
|
+
control: form.control,
|
|
13023
|
+
name: "email",
|
|
13024
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
|
|
13025
|
+
/* @__PURE__ */ jsx(Form$2.Label, { children: "Email" }),
|
|
13026
|
+
/* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
13027
|
+
/* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
|
|
13028
|
+
] })
|
|
13029
|
+
}
|
|
13030
|
+
) }),
|
|
13031
|
+
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
13032
|
+
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
13033
|
+
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
|
|
13034
|
+
] }) })
|
|
13035
|
+
]
|
|
13036
|
+
}
|
|
13037
|
+
) });
|
|
13038
|
+
};
|
|
13039
|
+
const schema = objectType({
|
|
13040
|
+
email: stringType().email()
|
|
13041
|
+
});
|
|
13042
13042
|
const widgetModule = { widgets: [] };
|
|
13043
13043
|
const routeModule = {
|
|
13044
13044
|
routes: [
|
|
@@ -13067,10 +13067,6 @@ const routeModule = {
|
|
|
13067
13067
|
Component: CustomItems,
|
|
13068
13068
|
path: "/draft-orders/:id/custom-items"
|
|
13069
13069
|
},
|
|
13070
|
-
{
|
|
13071
|
-
Component: Email,
|
|
13072
|
-
path: "/draft-orders/:id/email"
|
|
13073
|
-
},
|
|
13074
13070
|
{
|
|
13075
13071
|
Component: Items,
|
|
13076
13072
|
path: "/draft-orders/:id/items"
|
|
@@ -13098,6 +13094,10 @@ const routeModule = {
|
|
|
13098
13094
|
{
|
|
13099
13095
|
Component: TransferOwnership,
|
|
13100
13096
|
path: "/draft-orders/:id/transfer-ownership"
|
|
13097
|
+
},
|
|
13098
|
+
{
|
|
13099
|
+
Component: Email,
|
|
13100
|
+
path: "/draft-orders/:id/email"
|
|
13101
13101
|
}
|
|
13102
13102
|
]
|
|
13103
13103
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/draft-order",
|
|
3
|
-
"version": "2.10.4-preview-
|
|
3
|
+
"version": "2.10.4-preview-20250924210149",
|
|
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.10.4-preview-
|
|
39
|
+
"@medusajs/js-sdk": "2.10.4-preview-20250924210149",
|
|
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.10.4-preview-
|
|
49
|
-
"@medusajs/cli": "2.10.4-preview-
|
|
50
|
-
"@medusajs/framework": "2.10.4-preview-
|
|
51
|
-
"@medusajs/icons": "2.10.4-preview-
|
|
52
|
-
"@medusajs/test-utils": "2.10.4-preview-
|
|
53
|
-
"@medusajs/types": "2.10.4-preview-
|
|
54
|
-
"@medusajs/ui": "4.0.24-preview-
|
|
55
|
-
"@medusajs/ui-preset": "2.10.4-preview-
|
|
48
|
+
"@medusajs/admin-sdk": "2.10.4-preview-20250924210149",
|
|
49
|
+
"@medusajs/cli": "2.10.4-preview-20250924210149",
|
|
50
|
+
"@medusajs/framework": "2.10.4-preview-20250924210149",
|
|
51
|
+
"@medusajs/icons": "2.10.4-preview-20250924210149",
|
|
52
|
+
"@medusajs/test-utils": "2.10.4-preview-20250924210149",
|
|
53
|
+
"@medusajs/types": "2.10.4-preview-20250924210149",
|
|
54
|
+
"@medusajs/ui": "4.0.24-preview-20250924210149",
|
|
55
|
+
"@medusajs/ui-preset": "2.10.4-preview-20250924210149",
|
|
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.10.4-preview-
|
|
73
|
-
"@medusajs/cli": "2.10.4-preview-
|
|
74
|
-
"@medusajs/framework": "2.10.4-preview-
|
|
75
|
-
"@medusajs/icons": "2.10.4-preview-
|
|
76
|
-
"@medusajs/test-utils": "2.10.4-preview-
|
|
77
|
-
"@medusajs/ui": "4.0.24-preview-
|
|
72
|
+
"@medusajs/admin-sdk": "2.10.4-preview-20250924210149",
|
|
73
|
+
"@medusajs/cli": "2.10.4-preview-20250924210149",
|
|
74
|
+
"@medusajs/framework": "2.10.4-preview-20250924210149",
|
|
75
|
+
"@medusajs/icons": "2.10.4-preview-20250924210149",
|
|
76
|
+
"@medusajs/test-utils": "2.10.4-preview-20250924210149",
|
|
77
|
+
"@medusajs/ui": "4.0.24-preview-20250924210149",
|
|
78
78
|
"lodash": "^4.17.21",
|
|
79
79
|
"react-router-dom": "6.20.1"
|
|
80
80
|
},
|