@medusajs/draft-order 2.11.2-preview-20251030000332 → 2.11.2-preview-20251030032019
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,6 +9782,74 @@ 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
|
+
});
|
|
9785
9853
|
const NumberInput = React.forwardRef(
|
|
9786
9854
|
({
|
|
9787
9855
|
value,
|
|
@@ -11411,7 +11479,7 @@ const SalesChannelForm = ({ order }) => {
|
|
|
11411
11479
|
defaultValues: {
|
|
11412
11480
|
sales_channel_id: order.sales_channel_id || ""
|
|
11413
11481
|
},
|
|
11414
|
-
resolver: zod.zodResolver(schema$
|
|
11482
|
+
resolver: zod.zodResolver(schema$2)
|
|
11415
11483
|
});
|
|
11416
11484
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
11417
11485
|
const { handleSuccess } = useRouteModal();
|
|
@@ -11486,7 +11554,7 @@ const SalesChannelField = ({ control, order }) => {
|
|
|
11486
11554
|
}
|
|
11487
11555
|
);
|
|
11488
11556
|
};
|
|
11489
|
-
const schema$
|
|
11557
|
+
const schema$2 = objectType({
|
|
11490
11558
|
sales_channel_id: stringType().min(1)
|
|
11491
11559
|
});
|
|
11492
11560
|
const STACKED_FOCUS_MODAL_ID = "shipping-form";
|
|
@@ -12328,7 +12396,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12328
12396
|
postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
|
|
12329
12397
|
phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
|
|
12330
12398
|
},
|
|
12331
|
-
resolver: zod.zodResolver(schema$
|
|
12399
|
+
resolver: zod.zodResolver(schema$1)
|
|
12332
12400
|
});
|
|
12333
12401
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12334
12402
|
const { handleSuccess } = useRouteModal();
|
|
@@ -12498,7 +12566,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12498
12566
|
}
|
|
12499
12567
|
) });
|
|
12500
12568
|
};
|
|
12501
|
-
const schema$
|
|
12569
|
+
const schema$1 = addressSchema;
|
|
12502
12570
|
const TransferOwnership = () => {
|
|
12503
12571
|
const { id } = reactRouterDom.useParams();
|
|
12504
12572
|
const { draft_order, isPending, isError, error } = useDraftOrder(id, {
|
|
@@ -12522,7 +12590,7 @@ const TransferOwnershipForm = ({ order }) => {
|
|
|
12522
12590
|
defaultValues: {
|
|
12523
12591
|
customer_id: order.customer_id || ""
|
|
12524
12592
|
},
|
|
12525
|
-
resolver: zod.zodResolver(schema
|
|
12593
|
+
resolver: zod.zodResolver(schema)
|
|
12526
12594
|
});
|
|
12527
12595
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12528
12596
|
const { handleSuccess } = useRouteModal();
|
|
@@ -12972,76 +13040,8 @@ const Illustration = () => {
|
|
|
12972
13040
|
}
|
|
12973
13041
|
);
|
|
12974
13042
|
};
|
|
12975
|
-
const schema$1 = objectType({
|
|
12976
|
-
customer_id: stringType().min(1)
|
|
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
13043
|
const schema = objectType({
|
|
13044
|
-
|
|
13044
|
+
customer_id: stringType().min(1)
|
|
13045
13045
|
});
|
|
13046
13046
|
const widgetModule = { widgets: [] };
|
|
13047
13047
|
const routeModule = {
|
|
@@ -13071,6 +13071,10 @@ 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
|
+
},
|
|
13074
13078
|
{
|
|
13075
13079
|
Component: Items,
|
|
13076
13080
|
path: "/draft-orders/:id/items"
|
|
@@ -13098,10 +13102,6 @@ const routeModule = {
|
|
|
13098
13102
|
{
|
|
13099
13103
|
Component: TransferOwnership,
|
|
13100
13104
|
path: "/draft-orders/:id/transfer-ownership"
|
|
13101
|
-
},
|
|
13102
|
-
{
|
|
13103
|
-
Component: Email,
|
|
13104
|
-
path: "/draft-orders/:id/email"
|
|
13105
13105
|
}
|
|
13106
13106
|
]
|
|
13107
13107
|
}
|
|
@@ -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$
|
|
11476
|
+
resolver: zodResolver(schema$2)
|
|
11409
11477
|
});
|
|
11410
11478
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
11411
11479
|
const { handleSuccess } = useRouteModal();
|
|
@@ -11480,7 +11548,7 @@ const SalesChannelField = ({ control, order }) => {
|
|
|
11480
11548
|
}
|
|
11481
11549
|
);
|
|
11482
11550
|
};
|
|
11483
|
-
const schema$
|
|
11551
|
+
const schema$2 = objectType({
|
|
11484
11552
|
sales_channel_id: stringType().min(1)
|
|
11485
11553
|
});
|
|
11486
11554
|
const STACKED_FOCUS_MODAL_ID = "shipping-form";
|
|
@@ -12322,7 +12390,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12322
12390
|
postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
|
|
12323
12391
|
phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
|
|
12324
12392
|
},
|
|
12325
|
-
resolver: zodResolver(schema$
|
|
12393
|
+
resolver: zodResolver(schema$1)
|
|
12326
12394
|
});
|
|
12327
12395
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12328
12396
|
const { handleSuccess } = useRouteModal();
|
|
@@ -12492,7 +12560,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12492
12560
|
}
|
|
12493
12561
|
) });
|
|
12494
12562
|
};
|
|
12495
|
-
const schema$
|
|
12563
|
+
const schema$1 = addressSchema;
|
|
12496
12564
|
const TransferOwnership = () => {
|
|
12497
12565
|
const { id } = useParams();
|
|
12498
12566
|
const { draft_order, isPending, isError, error } = useDraftOrder(id, {
|
|
@@ -12516,7 +12584,7 @@ const TransferOwnershipForm = ({ order }) => {
|
|
|
12516
12584
|
defaultValues: {
|
|
12517
12585
|
customer_id: order.customer_id || ""
|
|
12518
12586
|
},
|
|
12519
|
-
resolver: zodResolver(schema
|
|
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
|
-
|
|
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"
|
|
@@ -13092,10 +13096,6 @@ const routeModule = {
|
|
|
13092
13096
|
{
|
|
13093
13097
|
Component: TransferOwnership,
|
|
13094
13098
|
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-20251030032019",
|
|
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-20251030032019",
|
|
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-20251030032019",
|
|
49
|
+
"@medusajs/cli": "2.11.2-preview-20251030032019",
|
|
50
|
+
"@medusajs/framework": "2.11.2-preview-20251030032019",
|
|
51
|
+
"@medusajs/icons": "2.11.2-preview-20251030032019",
|
|
52
|
+
"@medusajs/test-utils": "2.11.2-preview-20251030032019",
|
|
53
|
+
"@medusajs/types": "2.11.2-preview-20251030032019",
|
|
54
|
+
"@medusajs/ui": "4.0.26-preview-20251030032019",
|
|
55
|
+
"@medusajs/ui-preset": "2.11.2-preview-20251030032019",
|
|
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-20251030032019",
|
|
73
|
+
"@medusajs/cli": "2.11.2-preview-20251030032019",
|
|
74
|
+
"@medusajs/framework": "2.11.2-preview-20251030032019",
|
|
75
|
+
"@medusajs/icons": "2.11.2-preview-20251030032019",
|
|
76
|
+
"@medusajs/test-utils": "2.11.2-preview-20251030032019",
|
|
77
|
+
"@medusajs/ui": "4.0.26-preview-20251030032019",
|
|
78
78
|
"lodash": "^4.17.21",
|
|
79
79
|
"react-router-dom": "6.20.1"
|
|
80
80
|
},
|