Skip to content

Commit

Permalink
feat: super admin reorder restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
b3aton authored and kris-liu-smile committed Mar 10, 2023
1 parent 795e9bc commit d57f8b3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions apps/storefront/src/pages/orderDetail/components/OrderAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ import {
OrderDetailsContext,
} from '../context/OrderDetailsContext'

import {
snackbar,
} from '@/utils'

const OrderActionContainer = styled('div')(() => ({}))

/// orderCard
Expand Down Expand Up @@ -141,6 +145,12 @@ const OrderCard = (props: OrderCardProps) => {
currencyInfo,
} = props

const {
state: {
isAgenting,
},
} = useContext(GlobaledContext)

const navigate = useNavigate()

const dialogData = [
Expand Down Expand Up @@ -185,6 +195,10 @@ const OrderCard = (props: OrderCardProps) => {
} else if (name === 'printInvoice') {
window.open(`/account.php?action=print_invoice&order_id=${orderId}`)
} else {
if (!isAgenting) {
snackbar.error('To re-order, return or add product to shopping list, please masquerade')
return
}
setOpen(true)
setType(name)

Expand Down

0 comments on commit d57f8b3

Please sign in to comment.