Skip to content

Commit 8b61dcc

Browse files
authored
fix(dashboard,medusa): Minor clean-up of admin v2 (#7257)
1 parent 14d15df commit 8b61dcc

File tree

7 files changed

+21
-26
lines changed

7 files changed

+21
-26
lines changed

packages/admin-next/dashboard/src/components/layout/main-layout/main-layout.tsx

+15-12
Original file line numberDiff line numberDiff line change
@@ -87,29 +87,32 @@ const useCoreRoutes = (): Omit<NavItemProps, "pathname">[] => {
8787
label: t("orders.domain"),
8888
to: "/orders",
8989
items: [
90-
{
91-
label: t("draftOrders.domain"),
92-
to: "/draft-orders",
93-
},
90+
// TODO: Enable when domin is introduced
91+
// {
92+
// label: t("draftOrders.domain"),
93+
// to: "/draft-orders",
94+
// },
9495
],
9596
},
9697
{
9798
icon: <Tag />,
9899
label: t("products.domain"),
99100
to: "/products",
100101
items: [
101-
{
102-
label: t("collections.domain"),
103-
to: "/collections",
104-
},
102+
// TODO: Enable when domin is introduced
103+
// {
104+
// label: t("collections.domain"),
105+
// to: "/collections",
106+
// },
105107
{
106108
label: t("categories.domain"),
107109
to: "/categories",
108110
},
109-
{
110-
label: t("giftCards.domain"),
111-
to: "/gift-cards",
112-
},
111+
// TODO: Enable when domin is introduced
112+
// {
113+
// label: t("giftCards.domain"),
114+
// to: "/gift-cards",
115+
// },
113116
],
114117
},
115118
{

packages/admin-next/dashboard/src/components/layout/settings-layout/settings-layout.tsx

-8
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,10 @@ const useSettingRoutes = (): NavItemProps[] => {
3737
label: t("regions.domain"),
3838
to: "/settings/regions",
3939
},
40-
{
41-
label: t("returnReasons.domain"),
42-
to: "/settings/return-reasons",
43-
},
4440
{
4541
label: "Taxes",
4642
to: "/settings/taxes",
4743
},
48-
{
49-
label: "Locations",
50-
to: "/settings/locations",
51-
},
5244
{
5345
label: t("salesChannels.domain"),
5446
to: "/settings/sales-channels",

packages/admin-next/dashboard/src/hooks/api/customer-groups.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export const useAddCustomersToGroup = (
135135
options?: UseMutationOptions<
136136
AdminCustomerGroupResponse,
137137
Error,
138-
{ customer_ids: { id: string }[] }
138+
{ customer_ids: string[] }
139139
>
140140
) => {
141141
return useMutation({

packages/admin-next/dashboard/src/lib/client/customer-groups.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async function deleteCustomerGroup(id: string) {
5050

5151
async function batchAddCustomers(
5252
id: string,
53-
payload: { customer_ids: { id: string }[] }
53+
payload: { customer_ids: string[] }
5454
) {
5555
return postRequest<AdminCustomerGroupResponse>(
5656
`/admin/customer-groups/${id}/customers`,

packages/admin-next/dashboard/src/providers/router-provider/route-map.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ export const RouteMap: RouteObject[] = [
347347
path: "create",
348348
lazy: () =>
349349
import(
350-
"../../v2-routes/reservations/reservation-list/create-reservation"
350+
"../../v2-routes/customer-groups/customer-group-create"
351351
),
352352
},
353353
],

packages/admin-next/dashboard/src/v2-routes/customer-groups/customer-group-add-customers/components/add-customers-form/add-customers-form.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export const AddCustomersForm = ({
105105
const handleSubmit = form.handleSubmit(async (data) => {
106106
await mutateAsync(
107107
{
108-
customer_ids: data.customer_ids.map((id) => ({ id })),
108+
customer_ids: data.customer_ids,
109109
},
110110
{
111111
onSuccess: () => {

packages/medusa/src/api-v2/admin/price-lists/validators.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ export type AdminUpdatePriceListPriceType = z.infer<
5555
export const AdminCreatePriceList = z.object({
5656
title: z.string(),
5757
description: z.string(),
58-
starts_at: z.string().optional(),
59-
ends_at: z.string().optional(),
58+
starts_at: z.union([z.string(), z.null()]).optional(),
59+
ends_at: z.union([z.string(), z.null()]).optional(),
6060
status: z.nativeEnum(PriceListStatus).optional(),
6161
type: z.nativeEnum(PriceListType).optional(),
6262
rules: z.record(z.string(), z.array(z.string())).optional(),

0 commit comments

Comments
 (0)