fix(dashboard,medusa): Minor clean-up of admin v2 (#7257)
This commit is contained in:
@@ -87,10 +87,11 @@ const useCoreRoutes = (): Omit<NavItemProps, "pathname">[] => {
|
||||
label: t("orders.domain"),
|
||||
to: "/orders",
|
||||
items: [
|
||||
{
|
||||
label: t("draftOrders.domain"),
|
||||
to: "/draft-orders",
|
||||
},
|
||||
// TODO: Enable when domin is introduced
|
||||
// {
|
||||
// label: t("draftOrders.domain"),
|
||||
// to: "/draft-orders",
|
||||
// },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -98,18 +99,20 @@ const useCoreRoutes = (): Omit<NavItemProps, "pathname">[] => {
|
||||
label: t("products.domain"),
|
||||
to: "/products",
|
||||
items: [
|
||||
{
|
||||
label: t("collections.domain"),
|
||||
to: "/collections",
|
||||
},
|
||||
// TODO: Enable when domin is introduced
|
||||
// {
|
||||
// label: t("collections.domain"),
|
||||
// to: "/collections",
|
||||
// },
|
||||
{
|
||||
label: t("categories.domain"),
|
||||
to: "/categories",
|
||||
},
|
||||
{
|
||||
label: t("giftCards.domain"),
|
||||
to: "/gift-cards",
|
||||
},
|
||||
// TODO: Enable when domin is introduced
|
||||
// {
|
||||
// label: t("giftCards.domain"),
|
||||
// to: "/gift-cards",
|
||||
// },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -37,18 +37,10 @@ const useSettingRoutes = (): NavItemProps[] => {
|
||||
label: t("regions.domain"),
|
||||
to: "/settings/regions",
|
||||
},
|
||||
{
|
||||
label: t("returnReasons.domain"),
|
||||
to: "/settings/return-reasons",
|
||||
},
|
||||
{
|
||||
label: "Taxes",
|
||||
to: "/settings/taxes",
|
||||
},
|
||||
{
|
||||
label: "Locations",
|
||||
to: "/settings/locations",
|
||||
},
|
||||
{
|
||||
label: t("salesChannels.domain"),
|
||||
to: "/settings/sales-channels",
|
||||
|
||||
@@ -135,7 +135,7 @@ export const useAddCustomersToGroup = (
|
||||
options?: UseMutationOptions<
|
||||
AdminCustomerGroupResponse,
|
||||
Error,
|
||||
{ customer_ids: { id: string }[] }
|
||||
{ customer_ids: string[] }
|
||||
>
|
||||
) => {
|
||||
return useMutation({
|
||||
|
||||
@@ -50,7 +50,7 @@ async function deleteCustomerGroup(id: string) {
|
||||
|
||||
async function batchAddCustomers(
|
||||
id: string,
|
||||
payload: { customer_ids: { id: string }[] }
|
||||
payload: { customer_ids: string[] }
|
||||
) {
|
||||
return postRequest<AdminCustomerGroupResponse>(
|
||||
`/admin/customer-groups/${id}/customers`,
|
||||
|
||||
@@ -347,7 +347,7 @@ export const RouteMap: RouteObject[] = [
|
||||
path: "create",
|
||||
lazy: () =>
|
||||
import(
|
||||
"../../v2-routes/reservations/reservation-list/create-reservation"
|
||||
"../../v2-routes/customer-groups/customer-group-create"
|
||||
),
|
||||
},
|
||||
],
|
||||
|
||||
@@ -105,7 +105,7 @@ export const AddCustomersForm = ({
|
||||
const handleSubmit = form.handleSubmit(async (data) => {
|
||||
await mutateAsync(
|
||||
{
|
||||
customer_ids: data.customer_ids.map((id) => ({ id })),
|
||||
customer_ids: data.customer_ids,
|
||||
},
|
||||
{
|
||||
onSuccess: () => {
|
||||
|
||||
@@ -55,8 +55,8 @@ export type AdminUpdatePriceListPriceType = z.infer<
|
||||
export const AdminCreatePriceList = z.object({
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
starts_at: z.string().optional(),
|
||||
ends_at: z.string().optional(),
|
||||
starts_at: z.union([z.string(), z.null()]).optional(),
|
||||
ends_at: z.union([z.string(), z.null()]).optional(),
|
||||
status: z.nativeEnum(PriceListStatus).optional(),
|
||||
type: z.nativeEnum(PriceListType).optional(),
|
||||
rules: z.record(z.string(), z.array(z.string())).optional(),
|
||||
|
||||
Reference in New Issue
Block a user