diff --git a/src/components/admin/OrderInformationDetails.tsx b/src/components/admin/OrderInformationDetails.tsx index fc6352b..4713ec8 100644 --- a/src/components/admin/OrderInformationDetails.tsx +++ b/src/components/admin/OrderInformationDetails.tsx @@ -60,6 +60,17 @@ export const OrderPaymentInformationDetails = ({order, onMarkAsPayed}) => { } }; + const handleResendEmail = async () => { + try { + await axios.post("/api/admin/order/resend", { orderId: order.id, invoice: true }); + enqueueSnackbar("Confirmation email sent!", { variant: "success" }); + } catch (e) { + enqueueSnackbar("Error: " + (e?.response?.data ?? e.message), { + variant: "error" + }); + } + } + return ( <> @@ -74,6 +85,9 @@ export const OrderPaymentInformationDetails = ({order, onMarkAsPayed}) => { Mark as payed )} + + Resend Confirmation E-Mail + Detailed information (in case of payment errors @@ -102,6 +116,18 @@ export const OrderDeliveryInformationDetails = ({order, onMarkAsShipped, categor } }; + const handleResendTickets = async () => { + try { + await axios.post("/api/admin/order/resend", { orderId: order.id, tickets: true }); + enqueueSnackbar("Download Tickets sent!", { variant: "success" }); + onMarkAsShipped(); + } catch (e) { + enqueueSnackbar("Error: " + (e?.response?.data ?? e.message), { + variant: "error" + }); + } + } + const getShippingAddress = () => { const shipping = JSON.parse(order.shipping); if (shipping.data === "mock" || shipping.data === null || !shipping.data.differentAddress) return order.user; @@ -137,6 +163,9 @@ export const OrderDeliveryInformationDetails = ({order, onMarkAsShipped, categor Mark as shipped )} + + Resend download tickets + Detailed information