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",
|
||||
"return": "Return",
|
||||
"cancelWarning": "You are about to cancel the order {{id}}. This action cannot be undone.",
|
||||
"orderCanceled": "Order canceled successfully",
|
||||
"onDateFromSalesChannel": "{{date}} from {{salesChannel}}",
|
||||
"list": {
|
||||
"noRecordsMessage": "Your orders will show up here."
|
||||
|
||||
@@ -18,7 +18,6 @@ import { Link } from "react-router-dom"
|
||||
import { ActionMenu } from "../../../../../components/common/action-menu/index.ts"
|
||||
import { DataTable } from "../../../../../components/table/data-table/index.ts"
|
||||
import {
|
||||
customerGroupsQueryKeys,
|
||||
useCustomerGroups,
|
||||
useRemoveCustomersFromGroup,
|
||||
} 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 { useCustomerGroupTableQuery } from "../../../../../hooks/table/query/use-customer-group-table-query.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"
|
||||
|
||||
type CustomerGroupSectionProps = {
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
Heading,
|
||||
StatusBadge,
|
||||
Text,
|
||||
toast,
|
||||
usePrompt,
|
||||
} from "@medusajs/ui"
|
||||
import { format } from "date-fns"
|
||||
@@ -43,7 +44,14 @@ export const OrderGeneralSection = ({ order }: OrderGeneralSectionProps) => {
|
||||
return
|
||||
}
|
||||
|
||||
await cancelOrder()
|
||||
await cancelOrder(undefined, {
|
||||
onSuccess: () => {
|
||||
toast.success(t("orders.orderCanceled"))
|
||||
},
|
||||
onError: (e) => {
|
||||
toast.error(e.message)
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user