fix(dashboard): cancel order notifications (#10858)
* fix: cancel order notifications * fix: label
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -912,6 +912,7 @@
|
|||||||
"exchange": "Exchange",
|
"exchange": "Exchange",
|
||||||
"return": "Return",
|
"return": "Return",
|
||||||
"cancelWarning": "You are about to cancel the order {{id}}. This action cannot be undone.",
|
"cancelWarning": "You are about to cancel the order {{id}}. This action cannot be undone.",
|
||||||
|
"orderCanceled": "Order canceled successfully",
|
||||||
"onDateFromSalesChannel": "{{date}} from {{salesChannel}}",
|
"onDateFromSalesChannel": "{{date}} from {{salesChannel}}",
|
||||||
"list": {
|
"list": {
|
||||||
"noRecordsMessage": "Your orders will show up here."
|
"noRecordsMessage": "Your orders will show up here."
|
||||||
|
|||||||
-3
@@ -18,7 +18,6 @@ import { Link } from "react-router-dom"
|
|||||||
import { ActionMenu } from "../../../../../components/common/action-menu/index.ts"
|
import { ActionMenu } from "../../../../../components/common/action-menu/index.ts"
|
||||||
import { DataTable } from "../../../../../components/table/data-table/index.ts"
|
import { DataTable } from "../../../../../components/table/data-table/index.ts"
|
||||||
import {
|
import {
|
||||||
customerGroupsQueryKeys,
|
|
||||||
useCustomerGroups,
|
useCustomerGroups,
|
||||||
useRemoveCustomersFromGroup,
|
useRemoveCustomersFromGroup,
|
||||||
} from "../../../../../hooks/api/customer-groups.tsx"
|
} from "../../../../../hooks/api/customer-groups.tsx"
|
||||||
@@ -26,8 +25,6 @@ import { useCustomerGroupTableColumns } from "../../../../../hooks/table/columns
|
|||||||
import { useCustomerGroupTableFilters } from "../../../../../hooks/table/filters/use-customer-group-table-filters.tsx"
|
import { useCustomerGroupTableFilters } from "../../../../../hooks/table/filters/use-customer-group-table-filters.tsx"
|
||||||
import { useCustomerGroupTableQuery } from "../../../../../hooks/table/query/use-customer-group-table-query.tsx"
|
import { useCustomerGroupTableQuery } from "../../../../../hooks/table/query/use-customer-group-table-query.tsx"
|
||||||
import { useDataTable } from "../../../../../hooks/use-data-table.tsx"
|
import { useDataTable } from "../../../../../hooks/use-data-table.tsx"
|
||||||
import { sdk } from "../../../../../lib/client/index.ts"
|
|
||||||
import { queryClient } from "../../../../../lib/query-client.ts"
|
|
||||||
import { useBatchCustomerCustomerGroups } from "../../../../../hooks/api"
|
import { useBatchCustomerCustomerGroups } from "../../../../../hooks/api"
|
||||||
|
|
||||||
type CustomerGroupSectionProps = {
|
type CustomerGroupSectionProps = {
|
||||||
|
|||||||
+9
-1
@@ -6,6 +6,7 @@ import {
|
|||||||
Heading,
|
Heading,
|
||||||
StatusBadge,
|
StatusBadge,
|
||||||
Text,
|
Text,
|
||||||
|
toast,
|
||||||
usePrompt,
|
usePrompt,
|
||||||
} from "@medusajs/ui"
|
} from "@medusajs/ui"
|
||||||
import { format } from "date-fns"
|
import { format } from "date-fns"
|
||||||
@@ -43,7 +44,14 @@ export const OrderGeneralSection = ({ order }: OrderGeneralSectionProps) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
await cancelOrder()
|
await cancelOrder(undefined, {
|
||||||
|
onSuccess: () => {
|
||||||
|
toast.success(t("orders.orderCanceled"))
|
||||||
|
},
|
||||||
|
onError: (e) => {
|
||||||
|
toast.error(e.message)
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user